Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
KarenH
 
Posts: n/a
Default IF statement question

Can someone translate the following IF statement for me?

=IF((A2<"")*(ISNA(MATCH(A2,$A$1:A1,0))),"A","B")

I'm confused abut the first part, specifically the asterisk separating the
two criteria.
Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Franz Verga
 
Posts: n/a
Default IF statement question

Nel post
*KarenH* ha scritto:

Can someone translate the following IF statement for me?

=IF((A2<"")*(ISNA(MATCH(A2,$A$1:A1,0))),"A","B")

I'm confused abut the first part, specifically the asterisk
separating the two criteria.
Thanks!


Hi Karen,

The formula can be written also in this way:

=IF(AND((A2<""),(ISNA(MATCH(A2,$A$1:A1,0)))),"A", "B")

Its mean that:

IF A2<"" (i.e. A2 is not empty)

AND the value in A2 doesn't match the value in A1(the formula MATCH is used
to search the value in A2 in A1, if the two values are different, MATCH
function returns #N/A! error the formula ISNA convert the error in TRUE)

THEN write A in the cell the formula is written

ELSE write B in the cell.

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default IF statement question


Karen,

=IF((A2<"")*(ISNA(MATCH(A2,$A$1:A1,0))),"A","B")


IF A2 is not blank AND (*) A2 is not (ISNA) found (MATCH) in the range
$A$1:A1 then return the letter A IF both are not true then return the
letter B. You could write the formula like this,

=IF(AND(A2<"",ISNA(MATCH(A2,$A$1:A1,0))),"A","B")

Having the $ in the first A1 and not the second allows you to expand
the range when you copy down without losing the starting point.

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=555027

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
KarenH
 
Posts: n/a
Default IF statement question

Thanks to Franz and SteveG for this explanation -- that helped a lot! I'd
never seen the asterisk used as an "and" before, I always think of it as a
multiplication symbol.

I appreciate the helpful answers!



"Franz Verga" wrote:

Nel post
*KarenH* ha scritto:

Can someone translate the following IF statement for me?

=IF((A2<"")*(ISNA(MATCH(A2,$A$1:A1,0))),"A","B")

I'm confused abut the first part, specifically the asterisk
separating the two criteria.
Thanks!


Hi Karen,

The formula can be written also in this way:

=IF(AND((A2<""),(ISNA(MATCH(A2,$A$1:A1,0)))),"A", "B")

Its mean that:

IF A2<"" (i.e. A2 is not empty)

AND the value in A2 doesn't match the value in A1(the formula MATCH is used
to search the value in A2 in A1, if the two values are different, MATCH
function returns #N/A! error the formula ISNA convert the error in TRUE)

THEN write A in the cell the formula is written

ELSE write B in the cell.

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default IF statement question


You're welcome and thanks for the feedback.

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=555027



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default IF statement question

Yes the * is the multiplication symbol. In this instance, it is multiplying
two boolean values (true or false.) If both values are true, that works out
to be the same as AND. True and True = True. True * True = 1 (which is
true.) Anything else will be 0 or false. False * true (same as 0 * 1 and as
we all know, 0 times anything is 0.) True * False or False * False will be 0
(or false.)
--
Kevin Vaughn


"KarenH" wrote:

Thanks to Franz and SteveG for this explanation -- that helped a lot! I'd
never seen the asterisk used as an "and" before, I always think of it as a
multiplication symbol.

I appreciate the helpful answers!



"Franz Verga" wrote:

Nel post
*KarenH* ha scritto:

Can someone translate the following IF statement for me?

=IF((A2<"")*(ISNA(MATCH(A2,$A$1:A1,0))),"A","B")

I'm confused abut the first part, specifically the asterisk
separating the two criteria.
Thanks!


Hi Karen,

The formula can be written also in this way:

=IF(AND((A2<""),(ISNA(MATCH(A2,$A$1:A1,0)))),"A", "B")

Its mean that:

IF A2<"" (i.e. A2 is not empty)

AND the value in A2 doesn't match the value in A1(the formula MATCH is used
to search the value in A2 in A1, if the two values are different, MATCH
function returns #N/A! error the formula ISNA convert the error in TRUE)

THEN write A in the cell the formula is written

ELSE write B in the cell.

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy



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
Conditional Statement Question knbsmith11 Excel Discussion (Misc queries) 7 April 5th 06 09:12 PM
Nested IF Statement Question EleKtriKaz Excel Discussion (Misc queries) 6 April 5th 06 06:21 AM
IF Statement question gryfon Excel Worksheet Functions 6 May 4th 05 09:21 AM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
If Statement Question carl Excel Worksheet Functions 1 March 11th 05 04:55 AM


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