Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Formula to ask what Time/Date it is.

Hi,

Do you have any ideas what formula I could put together to set up the
following criteria:

Purpose: to determine what time/date a cell is populated with.

Action: If the date & time are < 14:00 then put today's date, if it's after
2pm then put tomorrow's date. I tried writing one:
=IF(D4<14:00,today(),today()+1) but for some reason excel didn't like what I
wrote.

I'm keen to put this formula into a macro so no one can alter the formula.
I'm happy doing that, it's just IF statements always trip me up!

Thanks for your help.
Peggy
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formula to ask what Time/Date it is.

=IF(D4<TIME(14,0,0),today(),today()+1)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Peggy" wrote in message
...
Hi,

Do you have any ideas what formula I could put together to set up the
following criteria:

Purpose: to determine what time/date a cell is populated with.

Action: If the date & time are < 14:00 then put today's date, if it's
after
2pm then put tomorrow's date. I tried writing one:
=IF(D4<14:00,today(),today()+1) but for some reason excel didn't like what
I
wrote.

I'm keen to put this formula into a macro so no one can alter the formula.
I'm happy doing that, it's just IF statements always trip me up!

Thanks for your help.
Peggy



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Formula to ask what Time/Date it is.


"Peggy" skrev i en meddelelse
...
Hi,

Do you have any ideas what formula I could put together to set up the
following criteria:

Purpose: to determine what time/date a cell is populated with.

Action: If the date & time are < 14:00 then put today's date, if it's
after
2pm then put tomorrow's date. I tried writing one:
=IF(D4<14:00,today(),today()+1) but for some reason excel didn't like what
I
wrote.

I'm keen to put this formula into a macro so no one can alter the formula.
I'm happy doing that, it's just IF statements always trip me up!

Thanks for your help.
Peggy


Hi Peggg

Try this

=IF(HOUR(D4)<14;NOW();NOW()+1)

Just remeber to format the cell as Date.

Regards,

Per


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Formula to ask what Time/Date it is.

May not be the suggestion you're looking for, but I put 14:00 in a cell,
say A1, then the following worked

=if(d4<A1, today(), today()+1)

I'm assuming D4 has the time field you're wanting to measure against.


I know it's all in the proper formatting of the time, but not sure how
to get there...

Rita


Peggy wrote:
Hi,

Do you have any ideas what formula I could put together to set up the
following criteria:

Purpose: to determine what time/date a cell is populated with.

Action: If the date & time are < 14:00 then put today's date, if it's after
2pm then put tomorrow's date. I tried writing one:
=IF(D4<14:00,today(),today()+1) but for some reason excel didn't like what I
wrote.

I'm keen to put this formula into a macro so no one can alter the formula.
I'm happy doing that, it's just IF statements always trip me up!

Thanks for your help.
Peggy



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Formula to ask what Time/Date it is.

Thank you everyone for your replies and help with this. Bob, your formula
has worked magic!!! Thanks again,
Peggy

"Bob Phillips" wrote:

=IF(D4<TIME(14,0,0),today(),today()+1)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Peggy" wrote in message
...
Hi,

Do you have any ideas what formula I could put together to set up the
following criteria:

Purpose: to determine what time/date a cell is populated with.

Action: If the date & time are < 14:00 then put today's date, if it's
after
2pm then put tomorrow's date. I tried writing one:
=IF(D4<14:00,today(),today()+1) but for some reason excel didn't like what
I
wrote.

I'm keen to put this formula into a macro so no one can alter the formula.
I'm happy doing that, it's just IF statements always trip me up!

Thanks for your help.
Peggy




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
date to time formula Brownie_D75 Excel Worksheet Functions 16 July 31st 09 09:02 PM
Calculating Time with Date/Time checking in formula cmatera Excel Worksheet Functions 2 August 11th 08 01:38 PM
Date/Time formula tmc Excel Worksheet Functions 2 January 16th 07 05:58 AM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM
Need help with date & time formula Jane Excel Worksheet Functions 5 December 10th 04 07:57 PM


All times are GMT +1. The time now is 10:55 PM.

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"