Greater than > Formula error? Date Field

M

martymk6

I would like a formula that compares two start dates and chooses the one
which is further in the future, and compares two finish dates and chooses the
finish date which is earliest.

here is my attempt but (greater than > and less than < dont seem to be
considered an argument in the formula entry box when it comes to dates?

ProjDateDiff((IIf[Start5]>[Start] ;[Start5] ;[Start]);(IIf[Finish4]<[Finish]
;[Finish4] ;[Finish]) ;"7day")
 
R

Rob Schneider

I've not completely debugged it (leave that to you as you know purpose),
but my version of the "number" formuula would be;

projdatediff(
IIf([Start5]>[Start],[Start5],[Start]),
IIf([Finish4]<[Finish],[Finish4],[Finish]))
/60/8

: projdatediff returns a number (minute) that is the project duration
between two dates
: divided by 60 minutes/hr and 8 hr/day to turn minutes in to days which
I figure you wanted
: used "," instead of ";" to separate parameters in the formula


--rms

www.rmschneider.com
 
J

Jim Aksel

I believe the problem is related to the return type of the IIF statement. I
worked it manually and was able to obtain results. What I did was insert
some date fields. In Date1 I use the formula
iif([Start5]>[Start],[Start5],[Start]) and that works fine returning a date
in Date1. I repeated with Date2 and the Finish IIF statements. Date2
returns a Finish date as expected.

After that I created a Duration1 column with the
ProjDateDiff([Date1],[Date2],"7 Day") and was able to achieve results in the
Duration1 column.

Something to consider, what if some of the dates have a value of NA?
--
If this post was helpful, please consider rating it.

Jim Aksel, MVP

Check out my blog for more information:
http://www.msprojectblog.com
 

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