Hi all,
Looking for help on a conditional format formula that is based on a text range within a cell. In my case, I would like to compare the low and high range when inputted as a number followed by the quotation marks followed by space then hyphen, space then number and ending in quotation marks. The quotation mark is being used to represent inches.
Like this in cell D14: 0.2” - 2.2”
I am using the following condition format formula which works for the strict case above.
However, there will be times when users using this spreadsheet may leave out the spaces on either side of the hyphen, or add more than one space between the number and hyphen. Also if additional digits are added, my formula above does not include all the digits in the results. I prefer to leave the quotation marks in.
I was able to come up with a great solution using Laurent Longre's WMID from (Morefunc add-in). In testing within the worksheet, it worked, but when I attempted to place in the condition format, I got the warning message saying “You may not use references to other worksheets or workbooks for conditional formatting criteria.”
The formula that works is:
I then split the formula above into two named ranges:
HighS16 =1*SUBSTITUTE(WMID('OCT 09S'!D$14,2,1,"-"),"""",0,1)
LowS16 =WMID('OCT 09S'!D$14,1,1,"""")*1
And substituted back in the conditional format as:
If expression is TRUE I have it set to highlight in red. But for some reason, the conditional format is not working.
Perhaps using named ranges would not be advantageous, since I have multiple columns with differing ranges. I would have to develop a separate named range for each column, making it harder to just drag and copy across and down.
Is there a work around to allow use of this formula or an equivalent non Morefunc formula that I can use?
Any assistance is appreciated.
Looking for help on a conditional format formula that is based on a text range within a cell. In my case, I would like to compare the low and high range when inputted as a number followed by the quotation marks followed by space then hyphen, space then number and ending in quotation marks. The quotation mark is being used to represent inches.
Like this in cell D14: 0.2” - 2.2”
I am using the following condition format formula which works for the strict case above.
HTML:
=OR(D16<LEFT($D$14,3)+0,D16>MID($D$14,8,3)+0)
However, there will be times when users using this spreadsheet may leave out the spaces on either side of the hyphen, or add more than one space between the number and hyphen. Also if additional digits are added, my formula above does not include all the digits in the results. I prefer to leave the quotation marks in.
I was able to come up with a great solution using Laurent Longre's WMID from (Morefunc add-in). In testing within the worksheet, it worked, but when I attempted to place in the condition format, I got the warning message saying “You may not use references to other worksheets or workbooks for conditional formatting criteria.”
The formula that works is:
HTML:
=OR(D16<WMID(D$14,1,1,"""")*1,D16>1*SUBSTITUTE(WMID(D$14,2,1,"-"),"""",0,1))
I then split the formula above into two named ranges:
HighS16 =1*SUBSTITUTE(WMID('OCT 09S'!D$14,2,1,"-"),"""",0,1)
LowS16 =WMID('OCT 09S'!D$14,1,1,"""")*1
And substituted back in the conditional format as:
HTML:
=OR(D16<LowS16,D16>HighS16)
If expression is TRUE I have it set to highlight in red. But for some reason, the conditional format is not working.
Perhaps using named ranges would not be advantageous, since I have multiple columns with differing ranges. I would have to develop a separate named range for each column, making it harder to just drag and copy across and down.
Is there a work around to allow use of this formula or an equivalent non Morefunc formula that I can use?
Any assistance is appreciated.