Looking to find a way of highlighting when 10055306 if present in a range.

JoRo_

New Member
Joined
Aug 9, 2024
Messages
1
Office Version
  1. Prefer Not To Say
Platform
  1. Windows
This is not my spreadsheet and pulls data in from many sources, so the cell listing the ranges cannot be expanded using text to columns.

10055306

10055274-10055303,10055305-10055307
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Lets assume you have your data in columna A starting from A2, how about using this formula in your conditional formatting:

Excel Formula:
=ISNUMBER(SEARCH("10055306", $A2))
 
Upvote 0
Lets assume you have your data in columna A starting from A2, how about using this formula in your conditional formatting:

Excel Formula:
=ISNUMBER(SEARCH("10055306", $A2))
That won't work - look a little more closely at the question.

Some of the values in column A are number spans, and they want to know if the number is between any of those spans, i.e. look at their example:
If the value in A2 is:
Rich (BB code):
10055274-10055303,10055305-10055307
and they want to see if:
Rich (BB code):
10055306
exists in any of those spans, that number does NOT explicitly appear in cell A2, but falls between the last span:
Rich (BB code):
10055305-10055307

So in that case, your formula would return FALSE, when it should return TRUE.
 
Upvote 0
Ohh, i see the coma should be seen as a column separator.
Try this formula then:

Book11.xlsx
ABC
1
210055274-1005530310055305-100553070
310055274-1005530310055306-100553071
Sheet4
Cell Formulas
RangeFormula
C2:C3C2=SUM(ISNUMBER(SEARCH("10055306", $A2:$B2&""))*1)
According to their requirements, it doesn't sound like they can expand it to multiple columns like that:

Quote from original post:
"This is not my spreadsheet and pulls data in from many sources, so the cell listing the ranges cannot be expanded using text to columns."
 
Upvote 0
You are right,

Maybe this will work:?

Book11.xlsx
ABC
1
210055274-10055303,10055305-100553071
Sheet4
Cell Formulas
RangeFormula
C2C2=SUM(MAP(TEXTSPLIT($A2, ","), LAMBDA(x, LET(v, VALUE(TEXTSPLIT(x, "-")), v_1, INDEX(v, 1, 1), v_2, INDEX(v, 1, 2), mV, 10055306, (mV>=v_1)*(mV<=v_2) )) ))
 
Upvote 0
You are right,

Maybe this will work:?

Book11.xlsx
ABC
1
210055274-10055303,10055305-100553071
Sheet4
Cell Formulas
RangeFormula
C2C2=SUM(MAP(TEXTSPLIT($A2, ","), LAMBDA(x, LET(v, VALUE(TEXTSPLIT(x, "-")), v_1, INDEX(v, 1, 1), v_2, INDEX(v, 1, 2), mV, 10055306, (mV>=v_1)*(mV<=v_2) )) ))
I have Excel 365, but that returns a #VALUE error for me.

Even if it does work, it is making a bunch of assumptions, i.e.
1. The user has Excel 365 so they have access to the LAMBDA function.
2. It appears that your formula may only look for 2 spans. However, it is not clear from the question if that is always true.
3. The user was not really clear on the scope of this question:
- are they looking for a single value within a single cell?
- are they looking for a single value within a range of cells?
- are they looking for multiple values across a range of cells?

So, some clarification from the user about which version of Excel they are using and the full scope of the question would be helpful!
 
Upvote 0
Yes of course all those question would have to be answered.
I have Excel 365, but that returns a #VALUE error for me.

That's weird. It works for me:

1723210615162.png
 
Upvote 0

Forum statistics

Threads
1,221,525
Messages
6,160,328
Members
451,637
Latest member
hvp2262

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