if countif is true, return the match

xtreme07

Board Regular
Joined
Sep 21, 2010
Messages
71
hi,

i need a formula that would return in columnC the match between columns A and B.

so, i need to scan colA using the colB, and return in colC the match that was found between the 2 col

---------------------/

columnA - one cell with a group of words (ex: going to gym)
columnB - single words. 100 lines

columnA is scaned using the list from columnB
------------//


your input is very much appreciated
 
Last edited:

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Excel Workbook
ABC
1going to the gymDogNo Match
2The boy can swim.gymgoing to the gym
3I have a catCatI have a cat
4the quick brown fox
...
Cell Formulas
RangeFormula
C1=IF(COUNTIF(A:A,"*"&B1&"*")>0,INDEX(A:A,MATCH("*"&B1&"*",A:A,0)),"No Match")
C2=IF(COUNTIF(A:A,"*"&B2&"*")>0,INDEX(A:A,MATCH("*"&B2&"*",A:A,0)),"No Match")
C3=IF(COUNTIF(A:A,"*"&B3&"*")>0,INDEX(A:A,MATCH("*"&B3&"*",A:A,0)),"No Match")
 
Upvote 0
ty AlphaDog for posting / for your help ... seems your formula is working fine. i also found meanwhile a formula that does exactly what i need and can be seen below for those that run into this thread and need similar help.

=IF(COUNTIF(A2,"*"&$B$2:$B$31&"*"),$B$2:$B$31,0)

AlphaDog - i would be interested how you pasted tables into your post. a link to the tutorial would be great if tyiping the answer here doesn't take to much time.

Edit: for some reason both formulas work only for the 1st cell and not the second,3rd and all others.. i wonder why ..
 
Last edited:
Upvote 0
AlphaFrog - i would be interested how you pasted tables into your post. a link to the tutorial would be great if tyiping the answer here doesn't take to much time.
Click on the links in my signature below.
 
Upvote 0
AlphaDog - i actually tried the formula and it doesn't do what i need, i tried tho some tweaking / inverting of cells and it does what is needed. so, bottom line: it works! but it doesn't :)

same as my formula, your formula works only for the 1st cell .. i wonder why .,. any ideea ?

here the inversion of the cells
=IF(COUNTIF(A2,"*"&B1:B100&"*")>0,INDEX(A2,MATCH("*"&B1:B100&"*",A2,0)),"No Match")

preview of what i need

group of word1, word1, word1
group of word1, group, group
group of word1, other, 0
 
Upvote 0
hi,

i need a formula that would return in columnC the match between columns A and B.

so, i need to scan colA using the colB, and return in colC the match that was found between the 2 col

---------------------/

columnA - one cell with a group of words (ex: going to gym)
columnB - single words. 100 lines

columnA is scaned using the list from columnB
------------//


your input is very much appreciated

Try...

Either:

=LOOKUP(9.99999999999999E+307,SEARCH($B$2:$B$100,A2),$B$2:$B$100)

Or: (probably better)

=LOOKUP(9.99999999999999E+307,SEARCH(" "&$B$2:$B$100&" "," "&A2&" "),$B$2:$B$100)
 
Upvote 0
Or this...
Excel Workbook
ABC
1group of word1word1word1
2group of word1groupgroup
3group of word1other0
...
Cell Formulas
RangeFormula
C1=IF(COUNTIF(A:A,"*"&B1&"*"), B1, 0)
C2=IF(COUNTIF(A:A,"*"&B2&"*"), B2, 0)
C3=IF(COUNTIF(A:A,"*"&B3&"*"), B3, 0)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,219
Members
452,895
Latest member
BILLING GUY

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