How can I check a part of string with row value and column value

nhnn1986

Board Regular
Joined
Oct 12, 2017
Messages
92
Hi all
I have workbook with data in sheet(data).range("A1:Ai) , i= last row

Now I want to mark YES with conditions match row and column for each Cell in range(cells(2,3),cells(lr,lc)) , lr = last row in column B, lc = last column in row
Else will mark NO

Data and result like table belove. Please help me.


[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A12345-B9123456-C123454-D20193-00[/TD]
[TD][/TD]
[TD]A12345[/TD]
[TD]A12346[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A12345-B9123456-C123456-D20193-00[/TD]
[TD]C123456[/TD]
[TD]YES[/TD]
[TD]YES[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]A12345-B9123456-C123455-D20193-00[/TD]
[TD]C123455[/TD]
[TD]YES[/TD]
[TD]NO[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]A12345-B9123456-C123456-D20193-00[/TD]
[TD]C123444[/TD]
[TD]NO[/TD]
[TD]NO[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]A12346-B9123456-C123456-D20193-00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]A12347-B9123456-C123456-D20193-00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD].....[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Maybe something like this:
Copy formula across and down as needed.
Excel Workbook
ABCD
1A12345-B9123456-C123454-D20193-00A12345A12346
2A12345-B9123456-C123456-D20193-00C123456YESYES
3A12345-B9123456-C123455-D20193-00C123455YESNO
4A12345-B9123456-C123456-D20193-00C123444NONO
5A12346-B9123456-C123456-D20193-00
6A12347-B9123456-C123456-D20193-00
Sheet
 
Upvote 0
Thanks for your fomula but my data is dynamic range so in coumn(A) maybe range(A1:A1000) or range(A1:A500) depend on each month. So Could you have another solution to do this?
 
Upvote 0
If your data wouldn't go beyond say row 5000 you could change the above formula to:

Code:
[TABLE="width: 756"]
<colgroup><col width="756"></colgroup>[TR]
   [TD="width: 756"]IF(SUMPRODUCT(ISNUMBER(SEARCH(C$1,$A$1:[COLOR=#ff0000]$A$5000[/COLOR]))*ISNUMBER(SEARCH($B2,$A$1[COLOR=#ff0000]:$A$5000[/COLOR])))>0,"YES","NO")
[/TD]
 [/TR]
[/TABLE]

Here is a link to set up a dynamic range which you could put in the formula above.
https://www.youtube.com/watch?v=13tY16Y19TY

Or try the following which is an array formula that must be entered with CTRL-SHIFT-ENTER. Then drag formula down and across as needed.
Excel Workbook
ABCD
1A12345-B9123456-C123454-D20193-00A12345A12346
2A12345-B9123456-C123456-D20193-00C123456YESYES
3A12345-B9123456-C123455-D20193-00C123455YESNO
4A12345-B9123456-C123456-D20193-00C123444NONO
5A12346-B9123456-C123456-D20193-00
6A12347-B9123456-C123456-D20193-00
Sheet
 
Upvote 0

Forum statistics

Threads
1,223,703
Messages
6,173,973
Members
452,540
Latest member
haasro02

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