• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

IF Function with OR(), using an array

Terence Mervis

New Member
Case - Column A is a long list of zip codes. Column B has in it only 6 specific zip codes.These 6 zip codes are also included among those zip codes listed in column A. How can the following formula be shortened using an array- =IF(OR(A1=$B$1,A1=$B$2,A1=$B$3,A1=$B$4,A1=$B$5,A1=$B$6),”Yes”,””)

Many Thanks
 
Shortened ways.

1] Array formula, confirmed pressing with CTRL+SHIFT+ENTER 3 keystrokes together :

=IF(OR(A1=B1:B6),"Yes","")

2] Or, this non-array formula :

=IF(SUMPRODUCT(0+OR(A1=B1:B6)),"Yes","")

Regards
 
Back
Top