Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Excel 2010 If Then logic - with time

I would like to use a time format as the logical test and the statement does not seem to recognize the time format. It converts it to some 1.XXXX number.
Any suggestions?

Thanx,

Richard
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Excel 2010 If Then logic - with time

I would like to use a time format as the logical
test and the statement does not seem to recognize
the time format. It converts it to some 1.XXXX
number.

Any suggestions?


If you're trying to test the value of a cell containing a time, remember that a time is really a number: a fraction of a day. For example, 0.5 is noon, or 12 hours (12:00) -- half a day. So compare times like numbers.

If you're trying to test if a cell is in the time format or not, take a look at the function
CELL(info_type, [reference])
with info_type="format".

(I have Excel 2010.)
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 829
Default Excel 2010 If Then logic - with time

"MyVeryOwnSelf" wrote:
I would like to use a time format as the logical
test and the statement does not seem to recognize
the time format.

[....]
If you're trying to test if a cell is in the time format
or not, take a look at the function CELL(info_type, [reference])
with info_type="format".


Caveat lector: CELL("format",A1) recognizes only some time formats. For
example, for hh:mm:ss, it returns "D8". But it returns "G" for [h]:mm:ss, a
common alternative.

Moreover, CELL is not recalculated if you only change the referenced cell's
format. So you must recalculate the cell that uses CELL manually, in one of
several ways.

IMHO, it is "bad practice" to use the cell's format as a formula condition.
But viable alternatives can only be suggested if/when the "rmscg15" explains
why he/she wants to rely on the cell format in the first place.

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
Having difficulty with Microsoft date & time picker in excel 2010 Bossman1 Setting up and Configuration of Excel 0 September 26th 12 06:15 PM
Run time error specifying range for sort code vba excel 2010 dial13[_2_] Excel Programming 2 September 10th 12 05:37 PM
Correction: Excel 2010 Chart Time Format JerryN Charts and Charting in Excel 0 September 3rd 12 06:21 PM
how can i get the date & time format 2010/02/17 12:05 in excel NarenSelva Excel Discussion (Misc queries) 2 March 2nd 10 08:56 AM
Form 4 Range of time from 1/20/2010 4:00 AM To 1/21/2010 10:00 AM Peter Gonzalez[_2_] Excel Worksheet Functions 2 January 26th 10 06:58 PM


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