One Cell, 2 IF

ryan7

Board Regular
Joined
Apr 30, 2020
Messages
84
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
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
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))
 
Upvote 0
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))
 
Upvote 0
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, "" ))))
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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
Back
Top