Conditional Help

JayReina13

New Member
Joined
Feb 16, 2011
Messages
4
Need help


so i have cells b2, C2, e2, f2, g2, that have different numbers and I want to check


if any of these cells numbers match cell A1 ( c2=3 and A1 = 3) then AA1 = 1, else leave blank

How can i do that ?


Thnaks in advance Jay
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
In AA1:
=IF(--SUM(B2=A1,C2=A1,E2=A2,F2=A1,G2=A1)>0,1,"")

B2=A1, etc. will all give a "true" or "false" answer. TRUE = 1, FALSE = 0, so when you add them up, if the answer is anything other than zero, you have a match. So if the answer is greater than 0, enter a 1. Otherwise, enter a blank ("").
 
Upvote 0
In AA1:
=IF(--SUM(B2=A1,C2=A1,E2=A2,F2=A1,G2=A1)>0,1,"")

B2=A1, etc. will all give a "true" or "false" answer. TRUE = 1, FALSE = 0, so when you add them up, if the answer is anything other than zero, you have a match. So if the answer is greater than 0, enter a 1. Otherwise, enter a blank ("").
You can reduce that to:

=IF(SUM(B2=A1,C2=A1,E2=A1,F2=A1,G2=A1),1,"")
 
Upvote 0
I didn't know if SUM would properly turn it into a number (hence the --). Learn something new every day.
 
Upvote 0
I didn't know if SUM would properly turn it into a number (hence the --). Learn something new every day.
Excel is kind of quirky like that.

Consider this...

Book1
BC
2TRUE0
3TRUE0
4TRUE4
5TRUE_
Sheet1

Formulas:

C2: =SUM(B2:B5)
C3: =SUM(B2,B3,B4,B5)
C4: =SUM(B2=TRUE,B3=TRUE,B4=TRUE,B5=TRUE)

The logical tests in C4 all evaluate to TRUE as do the referenced values in the other formulas yet the formula in C4 is the only one that returns the expected count.
 
Upvote 0
I knew there was something fishy about that =SUM() character. I never really trusted him. I always thought he was in cahoots with =VLOOKUP() to do something dastardly when he thought nobody was watching.
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top