ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If Statement (https://www.excelbanter.com/excel-worksheet-functions/212164-if-statement.html)

Ward

If Statement
 
Hi,

Please can you help,

I have a date in column A and a date in column B. In column C, I would like
the work 'Ok' to appear if the difference between the two dates is +/- 2
weeks. If the difference between the dates is more than +/-weeks then the
words 'not ok' to appear. Example:

A B C
01/01/04 01/01/04 OK
01/01/04 15/01/04 Not OK
16/03/04 15/03/04 OK
16/03/04 01/03/04 Not Ok

Thanks,
Ward



Mike H

If Statement
 
Hi,

I don't understand why
01/01/04 15/01/04 Not OK

evaluates as "Not OK" in you example but try this


=IF(ABS(B1-A1)<=14,"OK","Not OK")

Mike

"Ward" wrote:

Hi,

Please can you help,

I have a date in column A and a date in column B. In column C, I would like
the work 'Ok' to appear if the difference between the two dates is +/- 2
weeks. If the difference between the dates is more than +/-weeks then the
words 'not ok' to appear. Example:

A B C
01/01/04 01/01/04 OK
01/01/04 15/01/04 Not OK
16/03/04 15/03/04 OK
16/03/04 01/03/04 Not Ok

Thanks,
Ward



Ward

If Statement
 
Thank you,

sorry about the example - to much coffee

"Mike H" wrote:

Hi,

I don't understand why
01/01/04 15/01/04 Not OK

evaluates as "Not OK" in you example but try this


=IF(ABS(B1-A1)<=14,"OK","Not OK")

Mike

"Ward" wrote:

Hi,

Please can you help,

I have a date in column A and a date in column B. In column C, I would like
the work 'Ok' to appear if the difference between the two dates is +/- 2
weeks. If the difference between the dates is more than +/-weeks then the
words 'not ok' to appear. Example:

A B C
01/01/04 01/01/04 OK
01/01/04 15/01/04 Not OK
16/03/04 15/03/04 OK
16/03/04 01/03/04 Not Ok

Thanks,
Ward




All times are GMT +1. The time now is 09:38 AM.

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