Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Deb Deb is offline
external usenet poster
 
Posts: 102
Default When do I use quotation marks in an Excel formula?

What are the guidelines as to when you do and do not use quotation marks in
the criteria section of a function.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default When do I use quotation marks in an Excel formula?

Quotation marks around a text string; no quotation marks around a number.
--
David Biddulph

"Deb" wrote in message
...
What are the guidelines as to when you do and do not use quotation marks
in
the criteria section of a function.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default When do I use quotation marks in an Excel formula?

It can get confusing in some cases but the GENERAL rule of thumb is:

Always quote text
Never quote numbers

Now, here's a few examples of where it can get confusing!

=COUNTIF(A:A,"0")
=COUNTIF(A:A,""&B1)

Both COUNTIF and SUMIF evaluate TEXT numbers and numeric numbers as being
equal so both of these will work:

=COUNTIF(A:A,"0")
=COUNTIF(A:A,0)

=SUMPRODUCT(--(A1:A10=--"1/1/2009"))

In this case we're using a TEXT string to represent the date Jan 1 2009.
But, we're coercing that text string into a number value by using the double
unary: --.

If you just used:

=SUMPRODUCT(--(A1:A10="1/1/2009"))

Then the criteria is being evaluated as the literal TEXT string 1/1/2009 and
not the date 1/1/2009.

If you just used:

=SUMPRODUCT(--(A1:A10=1/1/2009))

Then the criteria is being evaluated as the math expression: 1 divided by 1
divided by 2009

So, there are many nuances to learn but if you follow the GENERAL rule of
thumb you'll be OK!

--
Biff
Microsoft Excel MVP


"Deb" wrote in message
...
What are the guidelines as to when you do and do not use quotation marks
in
the criteria section of a function.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default When do I use quotation marks in an Excel formula?

Use quotes when directly referencing a text value. If you are referencing a
cell (A2), you would use quotes only if using the INDIRECT() function.
Numeric values would not need quotes unless they are stored as text.

"Deb" wrote:

What are the guidelines as to when you do and do not use quotation marks in
the criteria section of a function.

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
how do i add quotation marks to every item in a column in excel s4mans Excel Discussion (Misc queries) 0 April 15th 08 07:51 PM
Literal quotation marks retained from a formula Chappy Excel Discussion (Misc queries) 3 February 5th 08 05:17 AM
How to stop Excel from inserting quotation marks into TXT files Dan Falk Excel Discussion (Misc queries) 1 April 13th 07 03:54 PM
Use quotation marks in a formula to display a qty in feet and inc. Jose Excel Worksheet Functions 1 May 12th 05 04:18 PM
Excel Quotation Marks! MaxFrance Excel Discussion (Misc queries) 6 March 29th 05 10:45 AM


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