#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Suz Suz is offline
external usenet poster
 
Posts: 21
Default IF Function

I am trying to set up an IF function, and can't figure out why it isn't
working. When I set up =IF(R2="Diameter",0), I get the correct answer. If I
ask =IF(R2="1/4" - 1 color",0), I get an error. I assume it is because the
look-up has the inch abbreviation (") and it is getting confused with a quote
mark. Because I am dealing with inch sizes, how can I get around this
without completely reconfiguring my whole worksheet?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default IF Function

One way is to replace the " with CHAR(34), i.e.

=IF(R2="1/4"&CHAR(34)&" - 1 color",0)

"Suz" wrote:

I am trying to set up an IF function, and can't figure out why it isn't
working. When I set up =IF(R2="Diameter",0), I get the correct answer. If I
ask =IF(R2="1/4" - 1 color",0), I get an error. I assume it is because the
look-up has the inch abbreviation (") and it is getting confused with a quote
mark. Because I am dealing with inch sizes, how can I get around this
without completely reconfiguring my whole worksheet?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 213
Default IF Function

I am trying to set up an IF function, and can't figure out why it
isn't working. When I set up =IF(R2="Diameter",0), I get the correct
answer. If I ask =IF(R2="1/4" - 1 color",0), I get an error. I
assume it is because the look-up has the inch abbreviation (") and it
is getting confused with a quote mark.


One way:
=IF(R2="1/4"&CHAR(34)&" - 1 color",0,"something else")

The ampersand (&) is concatenation of strings.

The double-quote is character number 34.

I added "something else" to make it obvious when there's a mismatch.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default IF Function

daddylonglegs wrote:
One way is to replace the " with CHAR(34), i.e.
=IF(R2="1/4"&CHAR(34)&" - 1 color",0)


That's the best I can come up with, too. But usually there is an
"escape" or "dammit" character in a language that allows us to specify
even the string terminator within a string. For example, in C, "1/4\"
-1 color" would work. Does one exist in Excel? If so, how would I
discover it with Excel Help? That is, what would I search for using
Excel Help (locally, not online)?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default IF Function

Just double up on the special char to use.

=IF(R2="1/4"" - 1 color",0)

HTH,
Elkar



" wrote:

daddylonglegs wrote:
One way is to replace the " with CHAR(34), i.e.
=IF(R2="1/4"&CHAR(34)&" - 1 color",0)


That's the best I can come up with, too. But usually there is an
"escape" or "dammit" character in a language that allows us to specify
even the string terminator within a string. For example, in C, "1/4\"
-1 color" would work. Does one exist in Excel? If so, how would I
discover it with Excel Help? That is, what would I search for using
Excel Help (locally, not online)?




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default IF Function

Elkar wrote:
Just double up on the special char to use.
=IF(R2="1/4"" - 1 color",0)


Fascinating! Any idea how I would have learned this on my own using
Excel Help (local, not online)? That is, what would I search for in
Excel Help to learn the syntax of strings. I guess I do not know what
Excel constants of the form "....". I tried "string syntax" and
"string constant", to no avail.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default IF Function

Hmm... There's a good question. I couldn't find anything about it either.
There is an obscure reference to using double ampersand (&&) characters in
headers/footers, but thats about all I could find.

" wrote:

Elkar wrote:
Just double up on the special char to use.
=IF(R2="1/4"" - 1 color",0)


Fascinating! Any idea how I would have learned this on my own using
Excel Help (local, not online)? That is, what would I search for in
Excel Help to learn the syntax of strings. I guess I do not know what
Excel constants of the form "....". I tried "string syntax" and
"string constant", to no avail.


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
Need some comments on my Utility_Move class module. jchen Excel Worksheet Functions 0 August 21st 06 07:05 PM
Creating a Custom Excel Function to Calculate Gini Coefficients [email protected] Excel Worksheet Functions 3 February 21st 06 10:15 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


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