Finding a number in a range from 1 cell

Russk68

Well-known Member
Joined
May 1, 2006
Messages
589
Office Version
  1. 365
Platform
  1. MacOS
Hello all,

I have a column with numbers and each row can contain a # or #># or #/#/#.(101 or 101>105 or 103/106/119)

I also have another column and each row has only 1 number.

For example:
Column A can only contain 1 number in each cell, lets say 103 in A1.
Column B can contain a number or ranges as noted above, lets say 101>105 in B15

I want to use conditional formatting in column A to indicate if 103 is found anywhere in column B.

Possible?

Thanks!

Russ
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Does this do what you want?
Select A1:A?? and apply the Conditional Formatting shown.

Excel Workbook
AB
1103
210
3202
4155103>101
53
63228
7
85/202/32
95208>33
10155
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A11. / Formula is =(A1<>"")*AGGREGATE(15,6,FIND("/"&A1&"/","/"&SUBSTITUTE($B$1:$B$10,">","/")&"/"),1)Abc
 
Upvote 0
That is so very close to what I am looking for.
In row 9 where you have 208>33, (I will always use the lower number on the left 33>208) I need any number in column A that is between 33 & 208 to format as True. So in your example, if 34 was entered in A8, It would format as True.

Hope that makes sense.

Thank you very much for your help!
 
Upvote 0
Try this one then.

Excel Workbook
AB
1103
210
3201
4155101>103
53
63228
7
81995/32/202
95183>200
10155
CF (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A11. / Formula is =(A1<>"")*AGGREGATE(14,6,IFERROR(FIND("/"&A1&"/","/"&$B$1:$B$10&"/"),0)+IFERROR((A1-LEFT(B$1:B$10,FIND(">",B$1:B$10)-1)>=0),0)*IFERROR((A1-REPLACE(B$1:B$10,1,FIND(">",B$1:B$10),"")<=0),0),1)Abc
 
Upvote 0
Hi Peter,
I have no idea what that all means but it works great!

Thank you very much!
 
Upvote 0
Hi Peter,
I would appreciate your help again.

I am trying to use your formula in a cell to return a 0 or 1. The reason is that, when typing in a cell in the column, it's very slow because of the complexity among 2200 cells of conditional formatting. I want the conditional formatting to work on 0 or 1 from your formula in a hidden column.

I tried doing this but it's not working as expected. I pasted your formula directly in C1 and dragged down.
Example of correct result:
A1=101 B1=101>103 C1=1

Example of incorrect result:
A2=101 B1=101>103 C1=0

The formula seems to only work in the same row.


After several attempts over many years, I still can't figure out how to paste a screen shot from a Mac.


101 101>103 1
101 105>107 0


Thanks!

Russ
 
Last edited:
Upvote 0
The formula needs to be an array formula. Conditional Formatting automatically treats it that way but when you put it in its own cell (C1) you need to confirm it with Ctrl+Shift+Enter, not just Enter. You can then copy it down.

The formula may not just produce 0 or 1 values but higher values as well as shown below. However, the CF formula can still just say "=C1" as 0 values will be treated as False and any other value treated as True.

So here is my sheet again with the old CF removed and this new CF using column C. I'm not sure if it will improve your sheet's performance significantly, but worth a try.

Excel Workbook
ABC
11031
2100
32010
4155101>1031
530
632283
70
81995/32/2021
95183>2001
101550
CF (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A11. / Formula is =C1Abc
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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