# function help

#### mort1703

##### Active Member
Hi

I am using the following function:

=IF(COUNTIF(A:A,B2)>0,"B","A")

Now this function allows me to search column A for matches in column B.

column a column b column c column d column e column f column g
alpha =IF(COUNTIF(A:A,B2)>0,"B","A") value = A 1 13 0 0
bravo alpha =IF(COUNTIF(A:A,B3)>0,"B","A") value = B 2 5 1 13
charlie =IF(COUNTIF(A:A,B4)>0,"B","A") value = A 1 8 0 0
delta alpha =IF(COUNTIF(A:A,B5)>0,"B","A") value = B 5 15 0 0

I need to expand the above formula to compare the values in columns b, f & g with columns a, d & e and give a value of A, B or C in column C

so if take the bravo row, it wants to know if cell b3,f3 and g3 matches the information in a2, d2 and e2, if, it matches exactly c3 should equal C, if b3 and a2 match a value of B else a value of A
so in this case I would expect c2 = A, c3 = B, c4 = A, c5 = B

not sure this can be done but would appreciate any help

### Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.

#### mort1703

##### Active Member
 COLUMN A COLUMN B COLUMN C COLUMN D COLUMN E COLUMN F COLUMN G ALPHA =IF(COUNTIF(A:A,B2)>0,"B","A") 1 13 0 0 BRAVO ALPHA =IF(COUNTIF(A:A,B3)>0,"B","A") 2 5 1 13 CHARLIE =IF(COUNTIF(A:A,B4)>0,"B","A") 1 8 0 0 DELTA ALPHA =IF(COUNTIF(A:A,B5)>0,"B","A") 5 15 0 0

sorry had a look at my previous post and realised my formatting wasn't great.

above is a small sample of the data.

I am using column b as sample data but we are looking at hundreds of rows of data and the data in column b could be anywhere in the column.

Replies
1
Views
87
Replies
5
Views
87
Replies
13
Views
196
Replies
1
Views
117
Replies
8
Views
168

Threads
1,129,754
Messages
5,638,170
Members
417,011
Latest member
Amaden95

### 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

### 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