One Cell, 2 IF

ryan7

New Member
Joined
Apr 30, 2020
Messages
34
Office Version
  1. 2016
Platform
  1. Windows
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
 

Some videos you may like

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
Joined
Oct 24, 2012
Messages
4,575
Office Version
  1. 365
Platform
  1. MacOS
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
Joined
Apr 30, 2020
Messages
34
Office Version
  1. 2016
Platform
  1. Windows
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
Joined
Oct 24, 2012
Messages
4,575
Office Version
  1. 365
Platform
  1. MacOS
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
Joined
Oct 19, 2015
Messages
133

ADVERTISEMENT

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
what about

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

Watch MrExcel Video

Forum statistics

Threads
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.
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