Solved

Conditional formatting the result of the formula in a cell

Posted on 2013-01-10
10
467 Views
Last Modified: 2013-01-10
I am having trouble with conditional formatting.  It seems that conditional formatting formula function only looks to the contents of the cell instead of looking at the formula result when the cell being conditionally formatted contains a formula.

How do I get around this?
0
Comment
Question by:IO_Dork
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 22

Expert Comment

by:mcsween
ID: 38763745
I created the following spreadsheet with formulas in column A calculating their values from B and C.  I used =COUNTIF(A:A,A1)>1 as my conditional formatting statement which looks for duplicate entries.  It seems to work fine as if it were looking at the formulas none of the cells would be highlighted because none are dups.  Can you post the formulas that create values as well as the formula you use for your conditional formatting?
condformat.xlsx
0
 

Author Comment

by:IO_Dork
ID: 38763894
2010 Excel:

Conditional formatting formula:
make cell background pink and font red if =$N9<TODAY()

Formatting Applies To Cells:
$N$9:$N$330

N9:N330 contains the formula:
=+IF(LEFT(BDP($G9 &" Corp"&" cusip",N$8),4)="#N/A","-",BDP($G9 &" Corp"&" cusip",N$8))

so if the above formula results in a date that is less than today's date (or a cells that displays a given date), then highlight the cell background with pink and font red.
0
 
LVL 34

Expert Comment

by:Norie
ID: 38763896
What condition are you using?

Conditional formatting looks at the value in the cell whether it's been manually entered or is the result of a formula.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 22

Expert Comment

by:mcsween
ID: 38763912
Try this
=DATEVALUE($N9<TODAY())

Open in new window

0
 
LVL 34

Expert Comment

by:Norie
ID: 38763934
What exactly does the formula in N9 return?

Is it a 'real' date or text that appears to be a date?
0
 

Author Comment

by:IO_Dork
ID: 38763940
i am using the last option "Use a formula to determine which cells to format"

also, if I overwrite the formula in the cell with an actual date, the conditional formula works...when I put back the "=+IF(LEFT(BDP($G9 &" Corp"&" cusip",N$8),4)="#N/A","-",BDP($G9 &" Corp"&" cusip",N$8))" formula, it stops working.
0
 

Author Comment

by:IO_Dork
ID: 38763957
the formula in N9 returns a settlement date...pulls the settlement date from Bloomberg...its works through the Bloomberg Excel add-in
0
 
LVL 22

Accepted Solution

by:
mcsween earned 500 total points
ID: 38763982
It's a type mismatch; you are trying to compare a date to a string.  You have to cast your string to a date before comparing them.  You may have to use

=DATEVALUE(+IF(LEFT(BDP($G9 &" Corp"&" cusip",N$8),4)="#N/A","-",BDP($G9 &" Corp"&" cusip",N$8)))

Open in new window

0
 
LVL 34

Expert Comment

by:Norie
ID: 38764013
mcsween

If that's the case, and I think it is, the formula you posted earlier should work - with a minor change.

=DATEVALUE($N9)<TODAY()
0
 

Author Closing Comment

by:IO_Dork
ID: 38764033
Thanks, That was the issue, a data type mismatch.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question