Solved Where is my mistake on this formular?

March 25, 2014 at 18:40:13
Specs: Windows 7
=IF(AND(AI8="-",AJ8="-"),AH8,IF(AND(AI8="-",AJ8>0),AH8+AJ8,IF(AND(AI8>0,AJ8>0),AH8+AI8+AJ8,AH8+AI8)))
First of all, cell AH8 is always >0 and my problem is I am trying to determine the formula if:
- cell AI8 ="-" and AJ8 ="-" then the cell I am trying to input formula equals AH8
- cell AJ8 = "-" and AI8 >0 then it equals AH8+AI8
- cell AI8 = "-" and AJ8>0 then it's AH8+AJ8
- cell AI8 and AJ8>0 then it's AH8+AI8+AJ8.
I am not sure where's the mistake of my formula. Please help!

See More: Where is my mistake on this formular?

Report •


#1
March 26, 2014 at 03:27:14
✔ Best Answer
Your problem is that AJ8>0 will evaluate as TRUE, if the cell contains a Dash,
so when you try to add AH8+AI8+AJ8 you get a value error

Try this:

=IF(AND(AI8="-",AJ8="-"),AH8,IF(AND(AI8="-",AJ8>0),SUM(AH8,AJ8),IF(AND(AI8>0,AJ8>0),SUM(AH8,AI8,AJ8),SUM(AH8,AI8))))

MIKE

http://www.skeptic.com/


Report •
Related Solutions


Ask Question