One Cell, 2 IF

ryan7

New Member
I'm looking to create a formula with more than 1 IF statement. This is the first part =IF(M5<1000,M5+N5+O5+P5,N5+O5+P5)
What I want to add is, IF cell U5 has "Y" then I want to subtract N5. If it has an "N", I want it to retain the value of cell N5.

Thank You

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

etaf

Well-known Member
If M5 is less than 1000 AND U5 is Y instead of
M5+N5+O5+P5
you want
M5-N5+O5+P5

What are the results you want for EACH of the conditions

AND( M5< 1000, U5 ="Y")
RESULT?

AND( M5 > = 1000, U5 ="Y")
RESULT?

AND( M5< 1000, U5 ="N")
RESULT?

AND( M5 > = 1000, U5 ="N")
RESULT?

Then if U5 is blank NOT a Y or a N
RESULT?

A NESTED if should work OK
Where for example you can add another IF , if the TEST is false
IF( TEST , TRUE , IF( TEST, TRUE FALSE))

ryan7

New Member
If M5 is less than 1000 AND U5 is Y instead of
M5+N5+O5+P5
you want
M5-N5+O5+P5

What are the results you want for EACH of the conditions

AND( M5< 1000, U5 ="Y")
RESULT?
M5+O5+P5
AND( M5 > = 1000, U5 ="Y")
RESULT?
O5+P5
AND( M5< 1000, U5 ="N")
RESULT?
M5+N5+O5+P5
AND( M5 > = 1000, U5 ="N")
RESULT?
N5+O5+P5
Then if U5 is blank NOT a Y or a N
RESULT?
It will always have a Y or N, It will never be blank.
A NESTED if should work OK
Where for example you can add another IF , if the TEST is false
IF( TEST , TRUE , IF( TEST, TRUE FALSE))

etaf

Well-known Member
AND( M5< 1000, U5 ="Y")
RESULT? M5+O5+P5

AND( M5 > = 1000, U5 ="Y")
RESULT? O5+P5

AND( M5< 1000, U5 ="N")
RESULT? M5+N5+O5+P5

AND( M5 > = 1000, U5 ="N")
RESULT? N5+O5+P5

Then if U5 is blank NOT a Y or a N
RESULT? NOT Viable , BUT I will add another nested just in case

so,

=IF ( AND( M5< 1000, U5 ="Y"), M5+O5+P5, IF( AND( M5 > = 1000, U5 ="Y"), O5+P5 , IF(AND( M5< 1000, U5 ="N"), M5+N5+O5+P5, IF( AND( M5 > = 1000, U5 ="N"), N5+O5+P5, "" ))))

dfsobral

Board Regular

I'm looking to create a formula with more than 1 IF statement. This is the first part =IF(M5<1000,M5+N5+O5+P5,N5+O5+P5)
What I want to add is, IF cell U5 has "Y" then I want to subtract N5. If it has an "N", I want it to retain the value of cell N5.

Thank You

=IF(M5<1000,M5+O5+P5,O5+P5) + IF(U5="Y",N5,0)

ryan7

New Member

=IF(M5<1000,M5+O5+P5,O5+P5) + IF(U5="Y",N5,0)
I had to switch the "Y" to "N" but this worked.
Thanks

dfsobral

Board Regular
wright it should be IF(U5="Y",0,N5)

Replies
6
Views
139
Replies
3
Views
61
Replies
16
Views
188
Replies
4
Views
89
Replies
11
Views
227

1,127,121
Messages
5,622,861
Members
415,935
Latest member
kes1973

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.

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

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