Fly2HMO
Posts: 7207
Joined: Sat Jan 24, 2004 12:14 pm

Question For The MS Excel Gurus: Formula Help?

Thu Feb 18, 2010 10:41 pm

So I'm building a spreadsheet where I need to calculate the operating cost per hour per route for a plane.

So in simple terms the formula would be column A (duration of flight) times column B (cost to operate aircraft per hour) = cost for flying the route

The problem is that I can't figure out for the life of me (short of converting hours to decimal format) how to make excel multiply the time in regular time format correctly to get the correct results.

A sample formula that I'm trying to do:

1:30hrs x $850= $38 (according to excel, WTF?!?)

The A column is selected to be in time format.

If i change the hours to normal general decimal format then excel gives me the right answer:

1.5hrs x $850 = $1275

I've searched like crazy on the help system and on google and cant find an answer.

I need to use non decimal format times for a presentation. Any ideas?

Using office 2007 by the way

[Edited 2010-02-18 14:42:49]
 
Phoenix9
Posts: 2042
Joined: Tue Aug 28, 2007 8:25 pm

RE: Question For The MS Excel Gurus: Formula Help?

Thu Feb 18, 2010 10:53 pm

Quoting FLY2HMO (Thread starter):
I need to use non decimal format times for a presentation. Any ideas?

Enter the time in minutes instead of hours, you won't need to enter decimals      


This is an indirect method: create another column with time in decimals and use that in your formula. When doing the presentation, just shrink the column to hide it or use 'white' as the text colour  

Sorry couldn't help more.
Life only makes sense when you look at it backwards.
 
2H4
Posts: 7960
Joined: Tue Oct 19, 2004 11:11 pm

RE: Question For The MS Excel Gurus: Formula Help?

Thu Feb 18, 2010 10:57 pm

Quoting Phoenix9 (Reply 1):
just shrink the column to hide it

You can also highlight the columns you'd like to hide, right click up on the letter of the column, and select 'hide'.
Intentionally Left Blank
 
Phoenix9
Posts: 2042
Joined: Tue Aug 28, 2007 8:25 pm

RE: Question For The MS Excel Gurus: Formula Help?

Thu Feb 18, 2010 11:02 pm

Quoting 2H4 (Reply 2):
You can also highlight the columns you'd like to hide, right click up on the letter of the column, and select 'hide'.

Oh yes. D'oh! Forgot that excel has that option.
Life only makes sense when you look at it backwards.
 
User avatar
casinterest
Posts: 5391
Joined: Sat Feb 12, 2005 5:30 am

RE: Question For The MS Excel Gurus: Formula Help?

Thu Feb 18, 2010 11:13 pm

You forget that you are using two different units values to multiply into $/hour. if you truly want $ per hour as your multiplier you need too have the time entered as hours. Think of this as a modulus operation on the true number.

Hours of the timestamp+Minutes of the Timestamp converted to hours by dividing by 60

I ran a sample listed below.


I offer up the following: Where A is your Time format in X:X and B is your Cash

=(HOUR($A1)+(MINUTE($A1)/60))*$B1

1:30 $850.00 $1,275.00
4:30 $850.00 $3,825.00
2:30 $850.00 $2,125.00
3:15 $850.00 $2,762.50
7:30 $850.00 $6,375.00
Older than I just was ,and younger than I will soo be.
 
User avatar
Dreadnought
Posts: 9841
Joined: Tue Feb 19, 2008 6:31 pm

RE: Question For The MS Excel Gurus: Formula Help?

Thu Feb 18, 2010 11:15 pm

Excel uses a time system based on day units, where 1 day =1, 1 hour = 0.041666667, 1 minute = 0.000694444 etc.

If you type in a cell a time in a recognizable format, like 1:30, excel automatically converts it to it's own system, which would be 0.0625.

The way to get around that is not to use such formats, and put in simply the units you want, like hours. 1.5 instead of 1:30.

You can do dozens of other things as well if you want to experiment with text parsers etc.
Forget dogs and cats - Spay and neuter your liberals.
 
petertenthije
Posts: 3267
Joined: Tue Jul 10, 2001 10:00 pm

RE: Question For The MS Excel Gurus: Formula Help?

Thu Feb 18, 2010 11:17 pm

I use the Dutch version, so the exact term might be slight different.

Say you got your begin time in cell A1, end time in B1 and the total time in C1 (=B1-A1).

You have two options, one simple one a bit longer:


A1 = 10:00
B1 = 12:30
C1 = 2:30
D1, add funtion "=HOUR(C1)", result will be "2", multiply this by the price per hour so you get "=HOUR(C1)*850". You'll get 2*850 = 1700.
E1, add funtion "=MINUTE(C1)", result will be "30", divide this by 60 (minutes) and multiply by the price per hour so you get "=(HOUR(C1)/60)*850". You'll get 0,5*850 = 425.
F1, add function =D1+F1". You'll get 1700 + 425 = 2125.

Or you can combine the function in cell D1 and E1 into one big function: "=(HOUR(C1)+(MINUTE(C1)/60))*850". If you really want to make your sheet future proof you might want to consider putting the price per hour in another cell and letting the formula refer to that cell. If the price per hour changes, you only need to change the input cell and not all functions.

[Edited 2010-02-18 15:19:00]
Attamottamotta!
 
Fly2HMO
Posts: 7207
Joined: Sat Jan 24, 2004 12:14 pm

RE: Question For The MS Excel Gurus: Formula Help?

Fri Feb 19, 2010 12:56 am

Oh man I'm drinking out of a firehose

(I just realized the implications of that, therefore...) *that's what she said*   

But I'll experiment with the suggestions.

Quoting Phoenix9 (Reply 1):
Enter the time in minutes instead of hours, you won't need to enter decimals

LOL sure smarty pants then I have to use operating cost per minute in the rest of the cells.

Quoting Dreadnought (Reply 5):
The way to get around that is not to use such formats, and put in simply the units you want, like hours. 1.5 instead of 1:30.

I'll do that for now just to get some useful numbers

Quoting casInterest (Reply 4):
=(HOUR($A1)+(MINUTE($A1)/60))*$B1
Quoting Petertenthije (Reply 6):
"=(HOUR(C1)+(MINUTE(C1)/60))*850"

That's probably what I'll end up using for the presentation.

Thanks ya'll!
 
Phoenix9
Posts: 2042
Joined: Tue Aug 28, 2007 8:25 pm

RE: Question For The MS Excel Gurus: Formula Help?

Fri Feb 19, 2010 1:01 am

Quoting FLY2HMO (Reply 7):
LOL sure smarty pants then I have to use operating cost per minute in the rest of the cells.

of course. then you just make another hidden cell that has the operating cost/minute and use it in your calculations  
Life only makes sense when you look at it backwards.

Who is online

Users browsing this forum: FreequentFlier and 19 guests