Solved

# If statement error

Posted on 2011-04-18
244 Views
Experts
Can you tell me what is wrong with this formula?
It just states "the formula you typed contains an error"
I think it is a parenthesis but I have tried many combinations to no avail.

=IF(GTExpireDate<FacilityExpirationDate),(SUM(MID(\$D\$15,SEARCH({"mon","day"},\$D\$15)-3,2)*{30,1}),"Expires After Facility Expiration")))

thank you
0
Question by:pdvsa

LVL 51

Accepted Solution

looks like you should remove first )

=IF(GTExpireDate<FacilityExpirationDate),(SUM(MID(\$D\$15,SEARCH({"mon","day"},\$D\$15)-3,2)*{30,1}),"Expires After Facility Expiration")))

-->

=IF(
GTExpireDate<FacilityExpirationDate,
SUM(MID(\$D\$15,SEARCH({"mon","day"},\$D\$15)-3,2)*{30,1}),"Expires After Facility Expiration")
)
0

Expert Comment

try it like this. your brackets were misplaced

=IF((GTExpireDate<FacilityExpirationDate),SUM(MID(\$D\$15,SEARCH({"mon","day"},\$D\$15)-3,2)*{30,1}),"Expires After Facility Expiration")
0

LVL 50

Expert Comment

Not for points....

Wass7's version should work for you but there's still a redundant pair of parentheses - this should be sufficient

=IF(GTExpireDate<FacilityExpirationDate,SUM(MID(\$D\$15,SEARCH({"mon","day"},\$D\$15)-3,2)*{30,1}),"Expires After Facility Expiration")

regards, barry

0

Author Comment

yes, there was a redudant set of ).  Excel did catch it and I forgot to mention this.

thank you.
0

LVL 51

Expert Comment

looks like I did not see the other )

=IF(GTExpireDate<FacilityExpirationDate),(SUM(MID(\$D\$15,SEARCH({"mon","day"},\$D\$15)-3,2)*{30,1}),"Expires After Facility Expiration")))

-->

=IF(
GTExpireDate<FacilityExpirationDate,
SUM(MID(\$D\$15,SEARCH({"mon","day"},\$D\$15)-3,2)*{30,1}),
"Expires After Facility Expiration"
)
0

## Featured Post

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …