LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default

gvm wrote...
....
My question: If the contents of the cell are formatted to be any of constant
number, date or time formats as specified by the HELP info, then what defines
the contents to be text in the first place?


You're pointing out an ambiguous use of the word 'format' or
'formatting' that's immediately obvious to programmers but not to
nonprogrammers. The argument to VALUE is *always* considered to be
text. If that text happens to be the same as the output/displayed
representation of some numeric value in some accepted number format,
then VALUE returns that numeric value.

This reply is just text. And the next nonblank line,

1,234,567.89

is just text. It looks like a formatted number, and VALUE would convert
it into the numeric value 1234567.89. Likewise, the following Excel
formula in cell A2,

="1,234,567.89"

would just be text in Excel even though it looks like a number.

In Excel, cell values are text if they're text constants (which I'll
define lazily as entries that aren't formulas and that Excel doesn't
interpret as numeric, boolean or error values) and formulas involving
text strings (anything within delimiting double quotes) and formulas
that return text values. Such text values may *appear* the same as
numeric, date or time values, but their appearance is *IRRELEVANT*.

When online help for the VALUE function says text formatted as numbers,
dates or times, it means characters *AS* *TEXT* that appear the same as
numeric, date or time values in some accepted number formats. Another
example, this time a date.

A1:
1

B2:
Jan

C3:
2006

D4:
=A1&"-"&B2&"-"&C3

Cell D4 will appear as 1-Jan-2006, which looks like a date value, but
it'd actually be a text value that just happens to look like a
formatted date value. It's *NOT* a date value. While many Excel
functions would treat D4 as a date value (e.g., DAY, MONTH, YEAR,
DATEDIF), the fundamental functions COUNT and ISNUMBER won't -
COUNT(D4) would return 0 and ISNUMBER(D4) would return FALSE. However,
ISNUMBER(VALUE(D4)) would return TRUE.

 
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
Function: New Web Query vinrouge Links and Linking in Excel 2 July 2nd 05 04:54 PM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM
mid function in ms query suhair Excel Discussion (Misc queries) 1 February 24th 05 04:51 PM


All times are GMT +1. The time now is 05:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"