IF number in A1 is contained in a cell in column B with other text

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
582
Office Version
  1. 365
Hi

In Column A I have a series of report numbers.

In Column B I have the file names. Some contain the word Report followed by a number that would appear in Column A

Column AColumn B
123456iguiguyRelated file 123567
123457ihohioh
123567Report 123457
124594hdiuhds hiohsodhohohoik Related file 125500
125500Report 124594

So in Column C I need a formula that looks at the value in column A, and if that number appears in Column B (Always will follow the word "Report") I need to have "Related file xxxxxx" appear. The file number will always be a 6 digit number

Thanks in advance
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
one way with helper col to separate the number from the string in col B
C2: =IFERROR(VALUE(RIGHT(B2,6)),RIGHT(B2,6))
D2: =IFERROR("Related file "&INDEX(A:A,MATCH(A2,C:C,0)),"")

There is a mismatch on you sample above, "Related file 123567" should be in C3 not C2
 
Upvote 0
How about
Fluff.xlsm
ABC
1
2123456iguiguy 
3123457ihohiohRelated file 123567
4123567Report 123457 
5124594hdiuhds hiohsodhohohoikRelated file 125500
6125500Report 124594 
Checks
Cell Formulas
RangeFormula
C2:C6C2=IFNA("Related file "&INDEX($A$2:$A$100,MATCH("*"&A2,$B$2:$B$100,0)),"")
 
Upvote 1
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,248
Messages
6,123,877
Members
449,130
Latest member
lolasmith

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