View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sarah Jane Sarah Jane is offline
external usenet poster
 
Posts: 11
Default Conditional formatting based on text within a formula

Thanks Max. Believe it or not, I thought of your suggestion shortly after I
posted the question; however, since I run several other macros on this data,
I can't change the column placements by adding another column. For now, I
may try to use column IV since this particular dataset hasn't YET maxed out
the number of columns available in Excel.

I have another workbook with a similar situation that has already maxed out
the number of columns, so if you think of another solution.....

"Max" wrote:

Imo, easiest way is to use a helper col (say col K) where you would indicate
say, a "2" in the col for such rows (A one-time manual pain, applied
retrospectively for what you already have on the sheet). Then just apply CF
in this manner.

Select the entire sheet (with A1 active)
Under Condition 1,
Formula is: =$K1=2
Format the fill/font, etc to taste OK out
The above would then conditionally highlight entire rows
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Sarah Jane" wrote:
I have several cells with formulas in them, and other cells have the same
formula divided by 2. My real formulas are rather complex, i.e. Cell X6 is
=INDEX(act!$A:$IR,MATCH($D6,act!$D:$D,0),MATCH(X$1 ,act!$1:$1,0))/2.
So, here is a very simplified example:
A B C
row 1: =Sheet1!A1 =Sheet1!B1 =Sheet1!C1
row 2: =Sheet1!A2/2 =Sheet1!B2/2 =Sheet1!C2/2
row 3: =Sheet1!A3 =Sheet1!B3 =Sheet1!C3
row 4: =Sheet1!A4 =Sheet1!B4 =Sheet1!C4
row 5: =Sheet1!A5/2 =Sheet1!B5/2 =Sheet1!C5/2

I want to use the conditional formatting option to highlight the cells that
are divided by 2. I tried "Formula Is
=IF(RIGHT(A2,2)="/2",TRUE,FALSE)=TRUE"; but since Excel 2003 SP2 is using the
value of A2 in the calculation instead of looking at the formula, I never get
a true condition. Then I thought about trying to replace the A2 in the
conditional formula mentioned above with CONCATENATE("'",A2) to fool Excel
into thinking the cell was formatted as text, but that didn't work either
because it still returned the value--only with an ' in front of it.

I have thousands of cells using these formulas, so creating helper columns
with text versions of the formulas is not possible, or at least not
practical. I think I could accomplish this with a macro, but I don't want to
have to run a macro every time I edit a cell or add more rows or columns.
Therefore, if you know of an Excel formula that I can use to access a
formulas text or you have any other suggestions, PLEASE, PLEASE let me know.

Thanks,
Sarah Jane Bowers