ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Change to formula (https://www.excelbanter.com/excel-discussion-misc-queries/190236-change-formula.html)

bbc1

Change to formula
 
Hi I am using this formula to return a date when spreadsheet is altered, I
require the date to ne one day less than the present day. Ie is the actual
date is 6/6/08 need it to return the 5/6/08
=IF(AND(B6="",B4<""),NOW(),IF(AND(B4<"",B6<""), B6,""))
any help would be greatly appreaciated.

Rick Rothstein \(MVP - VB\)[_619_]

Change to formula
 
Since the non-time portions are day offsets from some starting time, just
subtract 1 from the date and you will have the day before's date...

=IF(AND(B6="",B4<""),NOW()-1,IF(AND(B4<"",B6<""),B6,""))

By the way, if you only need the date, without the time portion, you can use
the TODAY() function in place of the NOW() function.

Rick


"bbc1" wrote in message
...
Hi I am using this formula to return a date when spreadsheet is altered, I
require the date to ne one day less than the present day. Ie is the actual
date is 6/6/08 need it to return the 5/6/08
=IF(AND(B6="",B4<""),NOW(),IF(AND(B4<"",B6<""), B6,""))
any help would be greatly appreaciated.



Bernard Liengme

Change to formula
 
Have you tried replacing NOW() by TODAY() - 1 ?
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"bbc1" wrote in message
...
Hi I am using this formula to return a date when spreadsheet is altered, I
require the date to ne one day less than the present day. Ie is the actual
date is 6/6/08 need it to return the 5/6/08
=IF(AND(B6="",B4<""),NOW(),IF(AND(B4<"",B6<""), B6,""))
any help would be greatly appreaciated.





All times are GMT +1. The time now is 05:28 PM.

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