Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Date-to-number in Excel

Hi all,

I have a cell that is a "start time" and a cell that is an "end time" and a
cell that is just the difference between the two. I have a fourth cell
that contains an arbitrary number. Say, 22. ie:

a b c d
13:00 13:40 0:40 22

The goal is to figure out what my rate per hour is. So I need to divide
sixty minutes by the time span to arrive at 1.5, then multiply that by d
(22) to get 33. So if I spent forty minutes doing something and I made 22
units, in an hour I would make 33. Simple, right?

I CAN'T FIGURE OUT HOW TO DO IT IN EXCEL!

I've tried changing the types, everything I can think of.

Help?

Thanks,
Jason
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Date-to-number in Excel

One way:

= D1/(C1/TIME(1,0,0))

or, equivalently:

= D1/(24*C1)


In article ,
Nascent wrote:

Hi all,

I have a cell that is a "start time" and a cell that is an "end time" and a
cell that is just the difference between the two. I have a fourth cell
that contains an arbitrary number. Say, 22. ie:

a b c d
13:00 13:40 0:40 22

The goal is to figure out what my rate per hour is. So I need to divide
sixty minutes by the time span to arrive at 1.5, then multiply that by d
(22) to get 33. So if I spent forty minutes doing something and I made 22
units, in an hour I would make 33. Simple, right?

I CAN'T FIGURE OUT HOW TO DO IT IN EXCEL!

I've tried changing the types, everything I can think of.

Help?

Thanks,
Jason

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Date-to-number in Excel

Thanks for the reply but it doesn't work. I've even made sure there was
no formatting that was munging up what I was seeing. I tried both
methods, too.

Regards,
Jason

JE McGimpsey wrote in
:

One way:

= D1/(C1/TIME(1,0,0))

or, equivalently:

= D1/(24*C1)


In article ,
Nascent wrote:

Hi all,

I have a cell that is a "start time" and a cell that is an "end time"
and a cell that is just the difference between the two. I have a
fourth cell that contains an arbitrary number. Say, 22. ie:

a b c d
13:00 13:40 0:40 22

The goal is to figure out what my rate per hour is. So I need to
divide sixty minutes by the time span to arrive at 1.5, then multiply
that by d (22) to get 33. So if I spent forty minutes doing
something and I made 22 units, in an hour I would make 33. Simple,
right?

I CAN'T FIGURE OUT HOW TO DO IT IN EXCEL!

I've tried changing the types, everything I can think of.

Help?

Thanks,
Jason



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Date-to-number in Excel

Both methods work for me. What does "doesn't work" mean to you? Do you
get the wrong value? An error? a crash?

Did you format the cell as General or another number format?

Are your times In article ,
Nascent wrote:

Thanks for the reply but it doesn't work. I've even made sure there was
no formatting that was munging up what I was seeing. I tried both
methods, too.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default Date-to-number in Excel

It works fine.
You need to format the cells with the formula as a number or currency,
Excel still thinks your looking for times.

Nascent wrote:

Thanks for the reply but it doesn't work. I've even made sure there was
no formatting that was munging up what I was seeing. I tried both
methods, too.

Regards,
Jason

JE McGimpsey wrote in
:


One way:

= D1/(C1/TIME(1,0,0))

or, equivalently:

= D1/(24*C1)


In article ,
Nascent wrote:


Hi all,

I have a cell that is a "start time" and a cell that is an "end time"
and a cell that is just the difference between the two. I have a
fourth cell that contains an arbitrary number. Say, 22. ie:

a b c d
13:00 13:40 0:40 22

The goal is to figure out what my rate per hour is. So I need to
divide sixty minutes by the time span to arrive at 1.5, then multiply
that by d (22) to get 33. So if I spent forty minutes doing
something and I made 22 units, in an hour I would make 33. Simple,
right?

I CAN'T FIGURE OUT HOW TO DO IT IN EXCEL!

I've tried changing the types, everything I can think of.

Help?

Thanks,
Jason





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Date-to-number in Excel

Actually, at this point I can get the longer method to work but not the
shorter. When I say "doesn't work" I mean the resulting box shows
"0:00". I did this by opening a new spreadsheet, entering the values as
such:

a b c d e
1 13:00 13:40 =B1-A1 22 =D1/(24*C1)

That does not work. I wind up with 0:00 in e1. But when I use the
longer version you sent (= D1/(C1/TIME(1,0,0))), it works just fine. I
just need to figure out why it's not working in my original sheet, so
you've still given me a solution.

Thanks!,
Jason

JE McGimpsey wrote in
:

Both methods work for me. What does "doesn't work" mean to you? Do you
get the wrong value? An error? a crash?

Did you format the cell as General or another number format?

Are your times In article
,
Nascent wrote:

Thanks for the reply but it doesn't work. I've even made sure there
was no formatting that was munging up what I was seeing. I tried
both methods, too.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Date-to-number in Excel

IF you wind up with 0:00 in E1, it's because you didn't format the cell
as General or another number format after entering the formula


In article ,
Nascent wrote:

Actually, at this point I can get the longer method to work but not the
shorter. When I say "doesn't work" I mean the resulting box shows
"0:00". I did this by opening a new spreadsheet, entering the values as
such:

a b c d e
1 13:00 13:40 =B1-A1 22 =D1/(24*C1)

That does not work. I wind up with 0:00 in e1. But when I use the
longer version you sent (= D1/(C1/TIME(1,0,0))), it works just fine. I
just need to figure out why it's not working in my original sheet, so
you've still given me a solution.

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
convert number to date in excel 2003 Wiji Excel Discussion (Misc queries) 2 June 25th 09 05:23 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
excel changes a number to a date and i don't want it to bobmcgod Excel Discussion (Misc queries) 2 July 18th 06 02:54 PM
Excel: I enter date and format for date, but shows as number spohar Excel Discussion (Misc queries) 2 March 10th 06 08:40 PM
how to get the number of days between two date formatted fields in vba for excel? Daniel Excel Worksheet Functions 1 July 12th 05 01:53 AM


All times are GMT +1. The time now is 01:15 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"