# Thread: Expand IF statement (2003)

1. ## Expand IF statement (2003)

Greetings,

I have the following formula (which works): =IF(AW2="Incorporated",DE2-HV2+1,IF(DE2="",IF(HV2="","",TODAY()-HV2),DE2-HV2+1))

Now, I tried the following (which DOES NOT function)

=IF(AW2="Incorporated",IF(DC="Change Cancelled",IF(DC="Change Rejected",DE2-HV2+1,IF(DE2="",IF(HV2="","",TODAY()-HV2),DE2-HV2+1))))

Columns AW and DC are always text

DE and HV are always dates

Any Ideas?

Thanks,

2. ## Re: Expand IF statement (2003)

What is DC? A defined name? It is not a reference to a cell since there is no row number.

The formula makes no sense because if DC (whatever it means) is equal to "Change Cancelled", it cannot be equal to "Change Rejected".

Could you try to explain what the formula should do?

3. ## Re: Expand IF statement (2003)

Oops..

should have stated DC2. DC2 could contain Change Cancelled, Change Rejected, Change Approved.

The expectation is as follows

IF the contents of AW2 = Incorporated, or if the contents of DC2 is Change Cancelled or Change Rejected then DE2-HV2+1, else if DE2= blank, of if HV2 =blank, then today-HV2 else DE2-HV2+1

Now, without the extra check for Change Cancelled and Change Rejected the formula works.

However I need the additional check so that the resultant number is correct.

The number returned is a count of days in whole numbers. Because of the data, the extra check is necessary to get the Real numbers.

4. ## Re: Expand IF statement (2003)

The solution is in the way you state the condition: you should use the OR function

=IF(OR(AW2="Incorporated",DC2="Change Cancelled",DC2="Change Rejected"),DE2-HV2+1,IF(DE2="",IF(HV2="","",TODAY()-HV2),DE2-HV2+1))

5. ## Re: Expand IF statement (2003)

Wonderful....

misplaced the OR function.....