ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   proper syntax order (https://www.excelbanter.com/excel-worksheet-functions/65982-proper-syntax-order.html)

Roberta H via OfficeKB.com

proper syntax order
 
Hello all, I have three fields

"ReceivedDate"
"Date"
"Total Days"

The first two are date fields, the second I want to either count the number
of days between the dates or if no "Date" than "Total Days" would should "0".


"Date" - "ReceivedDate" = "Total Days"
2/6/06 - 1/12/06 = 25
This works - if that's all I needed, however,

"Date" - "ReceivedDate" = "TotalDays", If "Date" is blank, then "TotalDays" =
0
I can't get the right order to make this simple formula work.
Please help.
Thank you.

--
Message posted via http://www.officekb.com

SteveG

proper syntax order
 

Roberta,

Assuming A1= "Date", B1 = "Received Date" & C1 = "Total Days" then in
C2 enter:

=IF(ISBLANK(A2),0,DATEDIF(B2,A2,"d"))

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=502625


Roberta H via OfficeKB.com

proper syntax order
 
Thank you so very much Steve!
Yes it works great! One problem I had, however, was getting an accurate
count from the very date received to the "date", so I made a very small
modification to the formula:
=IF(ISBLANK(H191),0,DATEDIF(G191-1,H191,"d")).

**************************************

SteveG wrote:
Roberta,

Assuming A1= "Date", B1 = "Received Date" & C1 = "Total Days" then in
C2 enter:

=IF(ISBLANK(A2),0,DATEDIF(B2,A2,"d"))

HTH

Steve


--
Message posted via http://www.officekb.com


All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com