Conditional Formatting using the number from text and a number

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
444
Office Version
  1. 365
Platform
  1. Windows
I have a formula -
=IFERROR(XLOOKUP(UNIQUE(FILTER(BE6:BE100,BE6:BE100<>"")),BE6:BE100,$BC6#&" - "&ROUND(BE6:BE100,0),""),"")
that returns text (column BC) and joins a number to it (column BE) then removes blank rows to get the list together
e.g. result as a spill
North West - 303
South East - 33
West Midlands - 156
Yorkshire and The Humber - 428
What I want to do is conditionally format each cell based on just the number part
So I tried using the following formula to extract the number in the "Format Values where this formula is true" section using
=RIGHT(BR6, LEN(BR6) - MAX(IF(ISNUMBER(MID(BR6, ROW(INDIRECT("1:"&LEN(BR6))), 1) *1)=FALSE, ROW(INDIRECT("1:"&LEN(BR6))), 0)))>(100+$BG$!)
Cell BG1 is a user number e.g. 20 so it should only format colour if the number is over 120
This doesn't work so I wondered if this can be achieved or not.
Any help would be appreciated.
Thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Perhaps use something like this, I haven't tested a spill formula in a cf rule so have no idea if it will work or not.
Excel Formula:
=UNIQUE(FILTER(BE6:BE100,BE6:BE100<>""))>(100+$BG$1)
 
Upvote 0
Try this:
Excel Formula:
=RIGHT(BC1, LEN(BC1)-FIND("- ",BC1))*1>100+$BG$1
 
Upvote 0
Solution
Hi
This worked but also showed blank cells as formatted coloured
=UNIQUE(FILTER(BE6:BE100,BE6:BE100<>""))>(100+$BG$1)

This one worked and left blank cells blank
=RIGHT(BC1, LEN(BC1)-FIND("- ",BC1))*1>100+$BG$1

Thank you both for all the help

One further question if I may -

When you have a cell with text and a number like this
North West - 303
South East - 33
West Midlands - 156
Yorkshire and The Humber - 428

Is it possible to sort by the number?

Thanks
 
Upvote 0
Maybe
Excel Formula:
=IFERROR(XLOOKUP(SORT(UNIQUE(FILTER(BE6:BE100,BE6:BE100<>""))),BE6:BE100,$BC6#&" - "&ROUND(BE6:BE100,0),""),"")
 
Upvote 0
That's amazing something so simple added to my formula. I would have thought it would have sorted by the text but it has sorted by the number.
Thankyou for all your help.
I would tick to go green but it will eliminate the green tick above
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,110
Members
449,205
Latest member
ralemanygarcia

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