formula for the custom field

M

Majid

Hello Dear,
I have two custom fields(Date 3 and Text 4) I want text 4 prints "yes" when
there is any date written on "Date 3 " field so that I can filter specific
tasks.
This is my formula located on "Text 4" field:

IIf([Date3]<>"value" And [Date3]<>"","yes")

I am getting an error message.
Would you please help me to troubleshoot this formula.
Thank you Majid
 
J

JackD

Date fields are never "", they are "NA" which you can test for.
Details about NA fields are here:
http://zo-d.com/blog/archives/project_management/microsoft_project/programming/index.html
Date fields are for dates so they will never be "value"
Further if Date3 uses a formula then you might have problems as well. It is
bad practice to have a custom formula use the results from another custom
formula.

But of course the real reason you are getting an error is that you are only
supplying two of the three arguments to the Iif functions

IIF(<test>,<value if true>, <value if false>)

I only see one comma in your formula. You need to supply the <value if
false>.

I'd use:

iif([Date3]=projdatevalue("NA"), "", "yes")
 
M

Majid

Hello Jack,
Thank you for your advice, it is really appreciated.
I plugged in the formula you provided in the "text4" field. Then I have
added the date to the "date3" field nothing happens on the "text4"
Please advise.


JackD said:
Date fields are never "", they are "NA" which you can test for.
Details about NA fields are here:
http://zo-d.com/blog/archives/project_management/microsoft_project/programming/index.html
Date fields are for dates so they will never be "value"
Further if Date3 uses a formula then you might have problems as well. It is
bad practice to have a custom formula use the results from another custom
formula.

But of course the real reason you are getting an error is that you are only
supplying two of the three arguments to the Iif functions

IIF(<test>,<value if true>, <value if false>)

I only see one comma in your formula. You need to supply the <value if
false>.

I'd use:

iif([Date3]=projdatevalue("NA"), "", "yes")


--
-Jack ... For project information and macro examples visit
http://masamiki.com/project
or http://zo-d.com/blog/index.html
..
Majid said:
Hello Dear,
I have two custom fields(Date 3 and Text 4) I want text 4 prints "yes" when
there is any date written on "Date 3 " field so that I can filter specific
tasks.
This is my formula located on "Text 4" field:

IIf([Date3]<>"value" And [Date3]<>"","yes")

I am getting an error message.
Would you please help me to troubleshoot this formula.
Thank you Majid
 
J

JackD

Try hitting the F9 key or set calculation to automatic.

--
-Jack ... For project information and macro examples visit
http://masamiki.com/project
or http://zo-d.com/blog/index.html
..
Majid said:
Hello Jack,
Thank you for your advice, it is really appreciated.
I plugged in the formula you provided in the "text4" field. Then I have
added the date to the "date3" field nothing happens on the "text4"
Please advise.


JackD said:
Date fields are never "", they are "NA" which you can test for.
Details about NA fields are here:
http://zo-d.com/blog/archives/project_management/microsoft_project/programming/index.html
Date fields are for dates so they will never be "value"
Further if Date3 uses a formula then you might have problems as well. It is
bad practice to have a custom formula use the results from another custom
formula.

But of course the real reason you are getting an error is that you are only
supplying two of the three arguments to the Iif functions

IIF(<test>,<value if true>, <value if false>)

I only see one comma in your formula. You need to supply the <value if
false>.

I'd use:

iif([Date3]=projdatevalue("NA"), "", "yes")


--
-Jack ... For project information and macro examples visit
http://masamiki.com/project
or http://zo-d.com/blog/index.html
..
Majid said:
Hello Dear,
I have two custom fields(Date 3 and Text 4) I want text 4 prints "yes" when
there is any date written on "Date 3 " field so that I can filter specific
tasks.
This is my formula located on "Text 4" field:

IIf([Date3]<>"value" And [Date3]<>"","yes")

I am getting an error message.
Would you please help me to troubleshoot this formula.
Thank you Majid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top