Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Okay working on a timesheet--still--
I need to be able to take the total number of miles driven and subtract a fixed number based on the total number of miles driven. For 1-99 miles subtract 50 miles--so for 91 miles driven I need it to show as 41 miles For 100-199 subtract 25 miles--so for 175 miles driven I need it to show as 150 miles Over 200 Subtract 0 miles-- so 225 as 225 Thanks! --Ms Chewie |
#2
![]() |
|||
|
|||
![]()
Hi!
Here's one way. E1 = miles driven =IF(E1="","",E1-LOOKUP(E1,{0,0;1,50;100,25;200,0})) Biff -----Original Message----- Okay working on a timesheet--still-- I need to be able to take the total number of miles driven and subtract a fixed number based on the total number of miles driven. For 1-99 miles subtract 50 miles--so for 91 miles driven I need it to show as 41 miles For 100-199 subtract 25 miles--so for 175 miles driven I need it to show as 150 miles Over 200 Subtract 0 miles-- so 225 as 225 Thanks! --Ms Chewie . |
#3
![]() |
|||
|
|||
![]()
Thanks, This worked great!
"Biff" wrote: Hi! Here's one way. E1 = miles driven =IF(E1="","",E1-LOOKUP(E1,{0,0;1,50;100,25;200,0})) Biff -----Original Message----- Okay working on a timesheet--still-- I need to be able to take the total number of miles driven and subtract a fixed number based on the total number of miles driven. For 1-99 miles subtract 50 miles--so for 91 miles driven I need it to show as 41 miles For 100-199 subtract 25 miles--so for 175 miles driven I need it to show as 150 miles Over 200 Subtract 0 miles-- so 225 as 225 Thanks! --Ms Chewie . |
#4
![]() |
|||
|
|||
![]()
Does that mean that if you drive only 25 miles you would
reimburse the company based on negative miles instead of getting paid for one file if you drove 51 miles. The easiest and most flexible way would be to set up a table for use with VLOOKUP then you don't have to change formulas.. http://www.mvps.org/dmcritchie/excel/vlookup.htm You might play with the following formula, it will not assign fewer than zero miles.. =IF(ISNUMBER(A2),IF(A2=200,A2,IF(A2=100,A2-25,MAX(0,A2-50))),"") --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Ms Chewie" wrote in message ... Okay working on a timesheet--still-- I need to be able to take the total number of miles driven and subtract a fixed number based on the total number of miles driven. For 1-99 miles subtract 50 miles--so for 91 miles driven I need it to show as 41 miles For 100-199 subtract 25 miles--so for 175 miles driven I need it to show as 150 miles Over 200 Subtract 0 miles-- so 225 as 225 Thanks! --Ms Chewie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Seed numbers for random number generation, uniform distribution | Excel Discussion (Misc queries) | |||
How to format a number in Indian style in Excel? | Excel Discussion (Misc queries) | |||
Count number of shaded cells | Excel Discussion (Misc queries) | |||
formula based on format | Excel Discussion (Misc queries) | |||
Use Julian Date To Create Serial Number | Excel Discussion (Misc queries) |