ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If Function Value if true = Date +30days (https://www.excelbanter.com/excel-discussion-misc-queries/135309-if-function-value-if-true-%3D-date-30days.html)

TypeType

If Function Value if true = Date +30days
 
Hello,

Question about IF function.
A1 = date of order;
B2= either "rejected" or "approved"
C3= +30 days if A2=rejected or +60 days if A2=approved

I tried to creat function for this:

A3 = IF(B2="rejected",A2+30,A2+60)

But the function is not returning a date. For example if

A1= 2/2/1990
B1=rejected
C1 = 32936

I don't know why its not working. Do I need to format it to return a date
somehow?

Thanks!


T. Valko

If Function Value if true = Date +30days
 
Try formatting the cell as DATE

In Excel dates are really just numbers that are formatted to look like
dates. The numbers are the number of days since a predefined date. That
predefined date is Jan 1 1900. So, the result you got is the 32936th day
since Jan 1 1900, or, when formatted as DATE, 4/3/1990.

Biff

"TypeType" wrote in message
...
Hello,

Question about IF function.
A1 = date of order;
B2= either "rejected" or "approved"
C3= +30 days if A2=rejected or +60 days if A2=approved

I tried to creat function for this:

A3 = IF(B2="rejected",A2+30,A2+60)

But the function is not returning a date. For example if

A1= 2/2/1990
B1=rejected
C1 = 32936

I don't know why its not working. Do I need to format it to return a date
somehow?

Thanks!




Vergel Adriano

If Function Value if true = Date +30days
 
Yes, you need to format it as a date.

Format-Cells, then select Date.


"TypeType" wrote:

Hello,

Question about IF function.
A1 = date of order;
B2= either "rejected" or "approved"
C3= +30 days if A2=rejected or +60 days if A2=approved

I tried to creat function for this:

A3 = IF(B2="rejected",A2+30,A2+60)

But the function is not returning a date. For example if

A1= 2/2/1990
B1=rejected
C1 = 32936

I don't know why its not working. Do I need to format it to return a date
somehow?

Thanks!



All times are GMT +1. The time now is 10:44 AM.

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