Nested If Function - What's wrong?

dccat33

New Member
Joined
Nov 17, 2009
Messages
1
Can someone please tell me what's wrong with the format of the following nested if function:

=J6+L7+N7-O7-R7-S7-IF(U6=0&U7=0,0,IF(U6>=0&U7<=0,-(U6-U7),IF(U6<=0&U7>=0,U6-U7,IF(U6<0&U7<0&U6<U7,-(U6-U7),IF(U6<0&U7<0&U6>U7,U6-U7,IF(U6>0&U7>0&U6>U7,-(U6-U7),IF(U6>0&U7>0&U6<U7,U6-U7)))))))

Thanks!
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

travis.m.roberts

Board Regular
Joined
Jul 7, 2009
Messages
62
I'm no expert but I think your problem is the way you are using the & in your IF statement. I think you have to go something like IF(AND(x, y),...)
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
welcome to the board...

Here's what's TECHNICALLY wrong with it...
Each IF can only read 1 criteria
U6>=0&U7<=0
That's 2 criteria 1. U6 > =0&U7 2. 0&U7 < =0

That explains the error messages when you try to enter the formula...


Now, what's really wrong with it, hard to say.
Hard to make sense of what 0&U7 means...

When you use & to combine to #s together, the resulting value is TEXT not a Number. So comparing that using an = or < or > operator won't work, because it's TEXT, not a nubmer..


Can you explain in words what you are trying to accomplish? There is probably a much better way..
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Probably not all you need because I also got lost in your syntax, but I think this should get you started
Code:
=SUM(J6,L7,N7)-SUM(O7,R7,S7)-ABS(U6-U7)

lenze
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,321
Members
414,053
Latest member
Dual Showman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top