Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default time calculation using IF function

I am trying to write a function that calculates a time card

I want to "say" that if you punch in between 8:00 am and 8:08 am, the time
will read 8:00 am, if it is 8:09 am, then the time will read 8:15 am.

I tried: c11<=08:08, 8:00 am, 8:15 am but it does not work.

Any thoughts?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default time calculation using IF function

Well, you could try

=IF(C11<="08:08"+0,"8:00"+0,"8:15"+0)

format as h:mm AM/PM

but what happens if c11 is 07:00 or 09:00? I know it won't give quite the
same result but what about

=ROUND(C11*96,0)/96

to round to the nearest quarter hour

"Polly" wrote:

I am trying to write a function that calculates a time card

I want to "say" that if you punch in between 8:00 am and 8:08 am, the time
will read 8:00 am, if it is 8:09 am, then the time will read 8:15 am.

I tried: c11<=08:08, 8:00 am, 8:15 am but it does not work.

Any thoughts?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default time calculation using IF function

Thank you! The rounding work great.

I really appreciate your help.

Polly

"daddylonglegs" wrote:

Well, you could try

=IF(C11<="08:08"+0,"8:00"+0,"8:15"+0)

format as h:mm AM/PM

but what happens if c11 is 07:00 or 09:00? I know it won't give quite the
same result but what about

=ROUND(C11*96,0)/96

to round to the nearest quarter hour

"Polly" wrote:

I am trying to write a function that calculates a time card

I want to "say" that if you punch in between 8:00 am and 8:08 am, the time
will read 8:00 am, if it is 8:09 am, then the time will read 8:15 am.

I tried: c11<=08:08, 8:00 am, 8:15 am but it does not work.

Any thoughts?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default time calculation using IF function



"Polly" wrote:

I am trying to write a function that calculates a time card

I want to "say" that if you punch in between 8:00 am and 8:08 am, the time
will read 8:00 am, if it is 8:09 am, then the time will read 8:15 am.

I tried: c11<=08:08, 8:00 am, 8:15 am but it does not work.

Any thoughts?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default time calculation using IF function

=IF(MINUTE(A1)<9,TIME(HOUR(A1),,),TIME(HOUR(A1),15 ,))

Format as h:mm AM/PM

"Polly" wrote:

I am trying to write a function that calculates a time card

I want to "say" that if you punch in between 8:00 am and 8:08 am, the time
will read 8:00 am, if it is 8:09 am, then the time will read 8:15 am.

I tried: c11<=08:08, 8:00 am, 8:15 am but it does not work.

Any thoughts?

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
Time Calculation For A Timesheet To Include Lunch poddys Excel Worksheet Functions 2 March 3rd 06 08:05 PM
Time Calculation Mike G Excel Worksheet Functions 1 February 17th 06 10:50 PM
Hyperlink function without openening new Explorer every time nijunge Excel Worksheet Functions 1 August 25th 05 09:11 AM
TIME function used in Excel jeramy Excel Worksheet Functions 1 July 2nd 05 02:59 AM
Time Calculation chintu49 Excel Worksheet Functions 2 February 16th 05 02:55 PM


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