Multiple Conditions

Sara_M

New Member
Joined
Nov 16, 2017
Messages
14
Hi all,
I have an issue coming up with an IF statement with multiple conditions.
Background Info:
We have a agreement from 2023 to 2026 with a company
if the duration is less than 1 year they get cashback of 5% based on Column N on Year 1
If the duration is >= then 1 they get 5% based on column K, for the first year, 4% for the second year and 3% on the third year.
I was able to do this calculation
Fees - First year = IF(O5<1,N5*0.05,K5*0.05)
Fees - Second Year = IF($O3<=1,0,IF($O3>1,$K3*0.04,$N3*0.04))
Fees - Third Year = IF($O3<=2,0,IF($O3>1,$K3*0.03,$N3*0.03))

1698662937244.png


But my problem is, if the contract started in 2024 instead, the maximum they can reach is 2 years, so I should add a statement saying something like if the year in column B is 2023, then IF($O3<=1,0,IF($O3>1,$K3*0.04,$N3*0.04)), if the year in column B is 2024 then IF(O5<1,N5*0.05,K5*0.05)

Not sure if it's clear, Year 1 depends on when the contract starts.

Many Thanks
 

Attachments

  • 1698662869141.png
    1698662869141.png
    10 KB · Views: 2
Finally sorted :biggrin: Z3:
Excel Formula:
=IF($O3<1,IF(YEAR($B3)-2022=COLUMN(A1),$N3*0.05,0),IF(AND(YEAR($B3)-2022<=COLUMN(A1),COLUMN(A1)-(YEAR($B3)-2022)<$O3),$K3*((5-(COLUMN(A1)-(YEAR($B3)-2022)))/100),0))
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Finally sorted :biggrin: Z3:
Excel Formula:
=IF($O3<1,IF(YEAR($B3)-2022=COLUMN(A1),$N3*0.05,0),IF(AND(YEAR($B3)-2022<=COLUMN(A1),COLUMN(A1)-(YEAR($B3)-2022)<$O3),$K3*((5-(COLUMN(A1)-(YEAR($B3)-2022)))/100),0))
Amazing thank you so much, I am going to study properly what you did, it's very cleaver
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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