Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Scott P
 
Posts: n/a
Default Using "double equal signs" in place of an IF statement

I am aware that you can evaluate two cells for equality using "double equal
signs" -- for example, by entering "=A1=B1" into cell C1 to test cells A1 and
B1 for equality. Is there a way to use this "double equal signs" approach in
place of an IF statement?

More specifically, is it possible to create a formula such as "=A1=B1
AVERAGE(1,2) "NA""? I have seen a formula such as this that did not include
commas between parameters -- any help on this front will be greatly
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Using "double equal signs" in place of an IF statement

Scott P wrote...
I am aware that you can evaluate two cells for equality using "double equal
signs" -- for example, by entering "=A1=B1" into cell C1 to test cells A1 and
B1 for equality. Is there a way to use this "double equal signs" approach in
place of an IF statement?


It's not double equal signs. The first equal sign indicates that the
cell contents is a formula while the second equal sign is a comparison
operator.

More specifically, is it possible to create a formula such as "=A1=B1
AVERAGE(1,2) "NA""? I have seen a formula such as this that did not include
commas between parameters -- any help on this front will be greatly
appreciated.


Not possible. If you could accept 0 as the result when A1<B1, you
could use

=(A1=B1)*AVERAGE(1,2)

or you could use some other function like CHOOSE, LOOKUP or INDEX
instead of IF, but there's no alternative to using one of these
functions if you want to return different type results (number or text)
depending on whether A1=B1 is TRUE or FALSE.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Scott P
 
Posts: n/a
Default Using "double equal signs" in place of an IF statement

Thank you, Harlan. I appreciate your reply and assistance.

"Harlan Grove" wrote:

Scott P wrote...
I am aware that you can evaluate two cells for equality using "double equal
signs" -- for example, by entering "=A1=B1" into cell C1 to test cells A1 and
B1 for equality. Is there a way to use this "double equal signs" approach in
place of an IF statement?


It's not double equal signs. The first equal sign indicates that the
cell contents is a formula while the second equal sign is a comparison
operator.

More specifically, is it possible to create a formula such as "=A1=B1
AVERAGE(1,2) "NA""? I have seen a formula such as this that did not include
commas between parameters -- any help on this front will be greatly
appreciated.


Not possible. If you could accept 0 as the result when A1<B1, you
could use

=(A1=B1)*AVERAGE(1,2)

or you could use some other function like CHOOSE, LOOKUP or INDEX
instead of IF, but there's no alternative to using one of these
functions if you want to return different type results (number or text)
depending on whether A1=B1 is TRUE or FALSE.


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
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
IF statement, can it equal more than one number? PhilGTI Excel Worksheet Functions 3 February 16th 05 12:06 AM
when writing an IF statement what is the syntax for "Not Equal to. NEEDTOKNOW Excel Discussion (Misc queries) 1 December 10th 04 04:45 PM
when writing an IF statement what is the syntax for "Not Equal to. NEEDTOKNOW Excel Discussion (Misc queries) 1 December 10th 04 04:32 PM


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