Nested if formula

SuzyQPA2

Board Regular
Joined
Oct 28, 2004
Messages
90
I have a formula and it works but i'd like to tweak it and can't seem to get it.

Here's the formula.
IF(YEAR(C4)=2017,IF(MONTH(C4)=1,F4*1.5%,IF(MONTH(C4)=2,F4*1.25%,IF(MONTH(C4)=3,F4*1%,IF(MONTH(C4)=4,F4*0.75%,IF(MONTH(C4)=5,F4*0.5%,IF(MONTH(C4)=6,F4*0.25%,0)))))))

Basically the formula says if the year is 2017 and the month is January - June, return the corresponding % increase.
Gripes:

I'd also like it to check another cell (j4)and see if the text says "per-diem" if yes then i want it to return zero, if no then continue with the formula.

If you can shorten the formula be my guest ;)
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi, to all!

It says too many levels of nesting

If you have this message, you use Excel 2003 or earlier.

You can use this formulae instead:
=F4*IF((J4<>"per diem")*(YEAR(C4)=2017),MAX(0,1.75%-MONTH(C4)*0.25%))

Blessings!
 
Upvote 0
Perhaps something like this:

=IF(AND(YEAR(C4)=2017,J4<>"per-diem"),F4*LOOKUP(MONTH(C4),{1,2,3,4,5,6},{0.015,0.0125,0.01,0.0075,0.005,0.0025}),0)
 
Last edited:
Upvote 0
Perhaps something like this:

=IF(AND(YEAR(C4)=2017,J4<>"per-diem"),F4*LOOKUP(MONTH(C4),{1,2,3,4,5,6},{0.015,0.0125,0.01,0.0075,0.005,0.0025}),0)

And of course, this will provide incorrect results if a date is entered for July-December. So, disregard the formula.
 
Upvote 0
Hi, to all!



If you have this message, you use Excel 2003 or earlier.

You can use this formulae instead:
=F4*IF((J4<>"per diem")*(YEAR(C4)=2017),MAX(0,1.75%-MONTH(C4)*0.25%))

Blessings!

Thanks - but if July - Dec in 2017 they don't get it - how do i adjust the formula
 
Upvote 0

Forum statistics

Threads
1,214,521
Messages
6,120,018
Members
448,937
Latest member
BeerMan23

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