Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ms Chewie
 
Posts: n/a
Default Subtracting based on number of miles

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   Report Post  
Biff
 
Posts: n/a
Default

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   Report Post  
David McRitchie
 
Posts: n/a
Default

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



  #4   Report Post  
Ms Chewie
 
Posts: n/a
Default

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

.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
How to format a number in Indian style in Excel? Victor_alb Excel Discussion (Misc queries) 2 December 21st 04 04:21 AM
Count number of shaded cells Maddoktor Excel Discussion (Misc queries) 2 December 20th 04 08:35 PM
formula based on format James Kendall Excel Discussion (Misc queries) 4 December 16th 04 04:47 PM
Use Julian Date To Create Serial Number antho10359 Excel Discussion (Misc queries) 4 December 9th 04 01:50 AM


All times are GMT +1. The time now is 10:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"