Problem with multiple IFS, IF and AND in long formula

arendberg

New Member
Joined
Jan 23, 2024
Messages
9
Office Version
  1. 2021
Platform
  1. MacOS
So I really hope someone can help me out here because this is driving me crazy! I need a formula to do the following.

I have a sheet with a lot of columns with different types of data. In a cell I need to calculate something based on multiple criteria.

If the date in column D is before 01-12-2023 and the text value in column L matches "Yes" make the 1st calculation. If the the date in column D is before 01-12-2023 and the text value in column L matches "No" make the 2nd calculation. If the date in column D is after 01-12-2023 and the text value in column L matches "Yes" make the 3rd calculation and finally when the date in D is after 01-12-2023 and the text value in column L is "No" make the 4th calculation.

This is already nested inside a larger IFS formula. I can get the the 1st calculation working but get stuck after that.

To make the story complete, these are the needed calculations:

1. F2/100*16,6*1,037
2. F2/100*13,6*1,037
3. (K2-G2)/100*16,6*1,038
4. (K2-G2)/100*13,6*1,038

Arosa Holiday 01-05-2023 <> 30-04-2024 data tm 06-03 v2.72.xlsx
ABCDEFGHIJKLM
1ArrivalDepartureRes. No.Created onDistribution ChannelLogisResort FeeWascheReinigungExtra'sTotalPreferredTest Formula
28/31/239/3/23102639/7/21Booking.comCHF 634.52CHF 133.08CHF 125.36CHF 212.15CHF 96.43CHF 1,201.54YesCHF 109.23
37/7/237/14/231085112/16/21Booking.comCHF 1,128.25CHF 81.00CHF 72.32CHF 154.29CHF 0.00CHF 1,435.87NoCHF 210.75
48/31/239/4/23102641/10/22AirbnbCHF 887.17CHF 115.72CHF 139.83CHF 212.15CHF 0.00CHF 1,354.87YesCHF 192.94
Sheet1
Cell Formulas
RangeFormula
M2:M4M2=IFERROR(IFS(E2="Booking.com",IF(AND(D2<DATEVALUE("1/12/2023"),L2="Yes"),(F2/100*16.6*1.037),((K2-G2)/100*15*1.037)),E2="Airbnb",SUM(F2+J2+H2+I2)/100*15*1.038,E2="Feratel",SUM(F2/100*15)/1.077,E2="Website",SUM(K2/100*3.5)),"0")
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I have not tried to do the nesting since you have not described this logic.
Here is a formula based word-for-word on your description:
Excel Formula:
=IF(D2<DATEVALUE("1/12/2023"),IF(L2="Yes",F2/100*16.6*1.037,IF(L2="No",F2/100*13.6*1.037,"")),IF(D2>DATEVALUE("1/12/2023"),IF(L2="Yes",(K2-G2)/100*16.6*1.038,IF(L2="No",(K2-G2)/100*13.6*1.037,"")),""))
This one is not dealing with the case when D2 equals 1/12/2023.
Below is another one which includes 1/12/2023 in the second condition:
Excel Formula:
=IF(D2<DATEVALUE("1/12/2023"),IF(L2="Yes",F2/100*16.6*1.037,IF(L2="No",F2/100*13.6*1.037,"")),IF(L2="Yes",(K2-G2)/100*16.6*1.038,IF(L2="No",(K2-G2)/100*13.6*1.037,"")))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,069
Messages
6,122,956
Members
449,096
Latest member
Anshu121

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