Nesting Formulas

honkin

Active Member
Joined
Mar 20, 2012
Messages
385
Office Version
  1. 2016
Platform
  1. MacOS
hi

I am struggling to put together a number of formulas to get the required result I am after.

I started off using the IF function and then tried the IFS function, but have not been able to put them together. Each of them works individually, but I have not been able to get the correct syntax to combine them.

Here are the 3 individually:-

Formula 1
Code:
=IF(AND(D2<=3,U2=1),95*S2-95,-100)

Formula 2
Code:
=IF(AND(D2>=4,D2<=7,U2<=2),95*S2-95,-100)

Formula 3
Code:
=IF(AND(D2>=8,U2<=3),95*S2-95,-100)

In English, IF formula 1 OR formula 2 or formula 3 are TRUE, perform the following calculation - 95*S2-95, if FALSE the result is -100

I tried this at the finally and it unfortunately gave all only positive results when U2 was showing as 1, so is obviously not working correctly either

Code:
=IF(AND(OR(D2<=3,U2=1),OR(D2>=4,D2<=7,U2<=2),OR(D2>=4,D2>=8,U2<=3)),95*S2-95,-100)

Using IFS I was unable to get it working at all.

Any suggestions of the correct syntax to have the 3 working together?

Thanks in advance
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi Honkin

I think you had the right idea but just the wrong order with the OR AND, try:

=IF(OR(AND(D2<=3,U2=1), AND(D2>=4,D2<=7,U2<=2), AND(D2>=8,U2<=3)), 95*S2-95,-100)
 
Upvote 0
ha!

Thanks so much for the reply, Finalfight40. Ah to be so close.

Thanks again. it works a treat
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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