You are here:

- Home
- Computing/Technology
- Business Software
- Excel
- Excel 10 Conditional Formating?

Advertisement

QUESTION: Hello, here is my Format for years service [ =(TODAY()-P81)/365 ].

P81 (Mar-14), R-81 (=(TODAY()-P81/365) results in [2] is correct.

I am trying to insert ("") for rows with cells that are blank or show no data, so that it shows a blank cell with the formula incase I add data to that row in that cell in the future. I cant seem to get the correct Function or insert the correct data in that function to perform this task.

I am also trying to highlight a different cell in that row that shows if that unit has surpassed the service date.

column heading (unit) cell D81, want cell (D81)highlighted if Cell R-81 > T-81 (red highlight). or if R-81 = T-81 (yellow highlight. is this possible through conditional formatting?

Thanks JAY

PS. I am converting Lotus 123, to Excel. Tough!

ANSWER: I'd be SLIGHTLY careful with your result, in that it's not 2 (based on what you've told me), but approximately 1.8 - although excel will show to zero decimal places (and therefore round up) the actual value is stored as specified. Depending how accurate you want your calculation to be you may also wish to look at the YEARFRAC function. Using your function, the method for the first part of the question would be

=IF(ISBLANK(P81),"",(TODAY()-P81)/365) which would return 1.810859...

Using YearFrac

=IF(ISBLANK(P81),"",YEARFRAC(TODAY(),P81)) would return 1.80833...

To use conditional formatting, I TEND to use the formula method so for the yellow formatting the formula would be

=R81=T81

and for the red formatting

=R81>T81

Hope this is clear, but do let me know if I can help or clarify further - should it help, my direct email is support@flameenterprises.co.uk

---------- FOLLOW-UP ----------

QUESTION: Yes that worked great.

how would I modify my rule for highlighting, if I wanted to highlight based on [ (1)(<)(cell value) ]. IM having trouble finding the way to type some number "minus" or less than another cell value.

for example [=R81(=,1<)T81],or [=81=(T81-1)].

ANSWER: I'm not following what it is you are trying to do, which may be the problem here for both of us - for conditional formatting, you need to use a logical test. In other words, something that will return true or false. SO formulating the expression in english is often a good starting point - IF you are saying

The value in R81 must be within 1 either side of the value in T81 (for example) then that can be translated to R81 must be greater than or equal to T81 minus one AND R81 must be less than or equal to T81 plus one. Which then becomes the excel formula:

=and(R81>=T81-1,R81<=T81+1)

the AND expression says both conditions must be true, and being a formula expression has to come first before you give the bits that need to be evaluated to true.

Hope this goes some way to helping - as before, feel free to email if you think sharing a spreadsheet would help to clarify.

---------- FOLLOW-UP ----------

QUESTION: Yes I will use the YearFrac function thanks.

for the last question I should clarify more.

-[sell or trade dates are set number(s) for that particular service vehicle].

-[service date, is the year the vehicle was purchased]

-I am trying to highlight a cell in terms of (years Service for a vehicle) that is within or equal to one year from(before) its (sell or trade date)[yellow]; and highlight the cell if its (service date) is => (sell/trade date)[red].

I think my question should be (1,2,3).

(1) with the yearfrac function already in the cell, do I need a separate function to highlight (red/Yellow) based on [red: (service date) = or > (sell/trade date); Yellow: (service date) {equal to (one year less than (sell/trade date) and/or within one year but not equal to (sell/trade date)?

(2) do I need multiple rules in that cell, one rule to highlight red, and one rule to highlight yellow, with the Yearfrac also for that cell?

(3) is it two separate entities that I am trying to fit in one cell (yearfrac + highlight), vs two separate criteria for that single cell (yearffrac is different rule or function than (highlight [red/yellow])?

hope that helps a little more.

thanks you are a great help...

It may well help to send me a sample file (support@flameenterprises.co.uk) but to clarify - any one cell can contain both a formula and conditional formatting - if the formula in a cell can be used with the conditional formatting, use it - there is no need to repeat the formula in the conditional format. Each condition (using the formula method) will return a true/false value and will trigger one format - so using this method, you need to have two conditions to trigger the yellow or red format

This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

Answers by Expert:

I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards. I'm based in the UK, so please allow for time differences when asking me questions from other parts of the world!

My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.**Education/Credentials**

I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!