Screwing up a nested IF function

Merlin Archer

New Member
Joined
Sep 25, 2016
Messages
8
Office Version
  1. 365
Platform
  1. MacOS
Hi. I'm creating a spreadsheet for a music group that pays tutor expenses for travel. For a round trip up to 200 miles the standard payment is £25, for a round trip of between 200 and 400 miles its £50, and anything over a 400 mile round trip pays £100. What I want is to be able to enter the mileage in one cell (D15) and use a nested IF function to automatically add the payment in another cell. I've created a nested iF function,

=IF(D15<201,"25",IF(D15>201<399,"50",IF(D15>400,"100")))

which works for the first term but returns FALSE for anything over. I'm nobody's Excel expert and can't see what I've got wrong. Any help would be greatly appreciated!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi Merlin,

Try this:

=IF(D15<=200,25,IF(AND(D15>=201,D15<=399),50,100))

Regards,

Robert
 
Upvote 0
Hi Merlin,

Try this:

=IF(D15<=200,25,IF(AND(D15>=201,D15<=399),50,100))

Regards,

Robert

Thank you Robert- that works beautifully! Its now nearly 1am; tomorrow when my brain has rested and been liberally doused in coffee I shall study your formula and learn!
 
Upvote 0
Shorter

Code:
=IF(D15<=200,25,IF(D15<=399,50,100))

Thank you Michael. Robert's answer arrived very quickly after I posted and I have used that; yours is different, shorter, and I shall use both in an effort to learn about nesting functions. Your reply is much appreciated.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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