Conditional Formatting 02-15-10

I have a date field (birthdates) in column B
In column A I do math on that date field to arrive at age 
(Today()-C3)/365) - (Not very accurate but works for my needs)
I would like Column A to be conditionally formatted based on the Date (month 
and day) in Column B.
I want the text to turn RED if we are approaching X number of days before 
that date (say 45).

How can I do this?

Thanks

Dave 

0
Dave
2/15/2010 4:13:52 PM
excel 39879 articles. 2 followers. Follow

7 Replies
770 Views

Similar Articles

[PageSpeed] 28

On Feb 15, 8:13=A0am, "Dave" <dave@accessdatapros> wrote:
> I have a date field (birthdates) in column B
> In column A I do math on that date field to arrive at age
> (Today()-C3)/365) - (Not very accurate but works for my needs)
> I would like Column A to be conditionally formatted based on the Date (mo=
nth
> and day) in Column B.
> I want the text to turn RED if we are approaching X number of days before
> that date (say 45).
>
> How can I do this?

It is a little confusing as you talk about columns A and B yet refer
to C3 in your formula, but I think this should satisfy the True or
False for conditional formatting. I'm using A and B as described, and
this compensates for birthdays gone past.

=3DIF(IF(DATE(YEAR(A1),MONTH(B1),DAY(B1))-
A1<0,DATE(YEAR(A1)+1,MONTH(B1),DAY(B1))-
A1,DATE(YEAR(A1),MONTH(B1),DAY(B1))-A1)<46,TRUE,FALSE)

If you want a second (actually first in a series of two conditions)
that highlights a different colour on the actual birthday, simplify
the aforementioned formula to read:

=3DIF(DATE(YEAR(A1),MONTH(B1),DAY(B1))-A1=3D0,TRUE,FALSE)


HTHs.
0
Kidaeshus
2/15/2010 5:53:21 PM
You are correct - my formula in the A column should be
(Today()-B3)/365)

Column A is formatted as a number
Column B is formatted as a Date

I could no get either of your formulas to work

"Kidaeshus" <google@magneticnorth.ca> wrote in message 
news:a1999702-7151-41c9-b21c-d0b2197fd2da@m27g2000prl.googlegroups.com...
> On Feb 15, 8:13 am, "Dave" <dave@accessdatapros> wrote:
>> I have a date field (birthdates) in column B
>> In column A I do math on that date field to arrive at age
>> (Today()-C3)/365) - (Not very accurate but works for my needs)
>> I would like Column A to be conditionally formatted based on the Date 
>> (month
>> and day) in Column B.
>> I want the text to turn RED if we are approaching X number of days before
>> that date (say 45).
>>
>> How can I do this?
>
> It is a little confusing as you talk about columns A and B yet refer
> to C3 in your formula, but I think this should satisfy the True or
> False for conditional formatting. I'm using A and B as described, and
> this compensates for birthdays gone past.
>
> =IF(IF(DATE(YEAR(A1),MONTH(B1),DAY(B1))-
> A1<0,DATE(YEAR(A1)+1,MONTH(B1),DAY(B1))-
> A1,DATE(YEAR(A1),MONTH(B1),DAY(B1))-A1)<46,TRUE,FALSE)
>
> If you want a second (actually first in a series of two conditions)
> that highlights a different colour on the actual birthday, simplify
> the aforementioned formula to read:
>
> =IF(DATE(YEAR(A1),MONTH(B1),DAY(B1))-A1=0,TRUE,FALSE)
>
>
> HTHs. 

0
Dave
2/15/2010 6:09:20 PM
On Feb 15, 10:09=A0am, "Dave" <dave@accessdatapros> wrote:
> You are correct - my formula in the A column should be
> (Today()-B3)/365)
>
> Column A is formatted as a number
> Column B is formatted as a Date
>
> I could no get either of your formulas to work

Sorry, my formula presupposed that A1 held =3DTODAY(). It constructs a
date from the day & month of the birthdate together with the year of
TODAY() and calculates the difference. For birthdays gone past (e.g. a
difference of less than zero), it adds a year to TODAY(). Substituting
TODAY() for all references of A1, this changes the formulas to:

=3DIF(IF(DATE(YEAR(TODAY()),MONTH(B1),DAY(B1))-
TODAY()<0,DATE(YEAR(TODAY())+1,MONTH(B1),DAY(B1))-
TODAY(),DATE(YEAR(TODAY()),MONTH(B1),DAY(B1))-TODAY())<46,TRUE,FALSE)

=3DIF(DATE(YEAR(TODAY()),MONTH(B1),DAY(B1))-TODAY()=3D0,TRUE,FALSE)

I think this may resolve things.




0
Kidaeshus
2/15/2010 6:24:27 PM
still no love.

I maybe applying it wrong

I will keep looking at it

Thanks for the replies

Dave

"Kidaeshus" <google@magneticnorth.ca> wrote in message 
news:b67d86a4-0fa9-47a9-a3cc-99e9e2a0172a@s25g2000prd.googlegroups.com...
> On Feb 15, 10:09 am, "Dave" <dave@accessdatapros> wrote:
>> You are correct - my formula in the A column should be
>> (Today()-B3)/365)
>>
>> Column A is formatted as a number
>> Column B is formatted as a Date
>>
>> I could no get either of your formulas to work
>
> Sorry, my formula presupposed that A1 held =TODAY(). It constructs a
> date from the day & month of the birthdate together with the year of
> TODAY() and calculates the difference. For birthdays gone past (e.g. a
> difference of less than zero), it adds a year to TODAY(). Substituting
> TODAY() for all references of A1, this changes the formulas to:
>
> =IF(IF(DATE(YEAR(TODAY()),MONTH(B1),DAY(B1))-
> TODAY()<0,DATE(YEAR(TODAY())+1,MONTH(B1),DAY(B1))-
> TODAY(),DATE(YEAR(TODAY()),MONTH(B1),DAY(B1))-TODAY())<46,TRUE,FALSE)
>
> =IF(DATE(YEAR(TODAY()),MONTH(B1),DAY(B1))-TODAY()=0,TRUE,FALSE)
>
> I think this may resolve things.
>
>
>
> 
0
Dave
2/15/2010 7:07:52 PM
> still no love.

OK, I figured out what you were trying to do with the formula in A1.
This would be to represent the number of years old of the individual
with the birthdate in B1. Since anything over xx.5 will average up to
the next year, it should instead be

=INT((TODAY()-B1)/365)

with custom formatting as 0"yo" as in 35yo for someone with 19/03/1974
in B1.

With your condition of 45 days, we can calculate that 45 days is
0.123288 of a year, so 1-(0.123288) is 0.876712 (remember that
number!)

With the focus on A1, go to Conditional Formatting (in Excel 2007)
through Home->Styles->Conditional Formatting->New Rule->Use a formula
to determine which cells to format. Where is says "Format values where
this value is true" put in:

=IF(MOD((TODAY()-B1)/365,1)>0.876712,TRUE,FALSE)

....and apply text colour or highlighting as required. Press OK.

That should do it. You can propagate the entire column A with Fill
Down (Ctrl+D)

HTHs.
0
Kidaeshus
2/15/2010 8:16:20 PM
Seems I was testing this on one of those rare dates that are just not 
working due to math errors in using 365 days.
My Birthday 2/18/1951

shows me as 59 - I will not be for 3 days.

Your conditional formatting was not working on this date (my test date) and 
I did not try it on any other date.
When I did - it does now seem to work

Thanks for your help

Dave

"Kidaeshus" <google@magneticnorth.ca> wrote in message 
news:81ee8438-7221-498c-8118-ff57fff704f4@t17g2000prg.googlegroups.com...
>> still no love.
>
> OK, I figured out what you were trying to do with the formula in A1.
> This would be to represent the number of years old of the individual
> with the birthdate in B1. Since anything over xx.5 will average up to
> the next year, it should instead be
>
> =INT((TODAY()-B1)/365)
>
> with custom formatting as 0"yo" as in 35yo for someone with 19/03/1974
> in B1.
>
> With your condition of 45 days, we can calculate that 45 days is
> 0.123288 of a year, so 1-(0.123288) is 0.876712 (remember that
> number!)
>
> With the focus on A1, go to Conditional Formatting (in Excel 2007)
> through Home->Styles->Conditional Formatting->New Rule->Use a formula
> to determine which cells to format. Where is says "Format values where
> this value is true" put in:
>
> =IF(MOD((TODAY()-B1)/365,1)>0.876712,TRUE,FALSE)
>
> ...and apply text colour or highlighting as required. Press OK.
>
> That should do it. You can propagate the entire column A with Fill
> Down (Ctrl+D)
>
> HTHs. 

0
Dave
2/15/2010 9:20:01 PM
> shows me as 59 - I will not be for 3 days.

Try 365.25 to get a closer approximation ("Not very accurate but works
for my needs") or use the formula that constructs the subtrahend date
from the birthdate's day & month together with the current year for an
exact comparison.

YW.

0
Kidaeshus
2/15/2010 9:51:17 PM
Reply:

Similar Artilces:

Today Conditional Format
I have a column which calculated a date based on 3 working days from a date input into a diff column. What I want to do I have the calculated date appear bold if that date has passed based on the current date. For example if I input 01/08/11 the next column calculates 04/08/11 (3 working days). I want the caluclated date to appear bold when I open the spreadsheet on the 05/08/11 ro show the calculated date has passed. I can use conditional formatting but can't get the syntax right Regards Andy Win XP Pro Office 2010 Andy Roberts presented the following explanation : > I ha...

Two Condition Vlookup?
I am currently trying to create a function that searches through an array for two exact column values which allows me to retrieve a third column value. For example: Type of Fruit Date Packaged Amount of Fruit Apples June 100 Oranges June 50 Apples July 75 Grapes July 50 In this example, I would be looking to retrieve the Amount of Fruit (Apples) that was packaged in July. I would be putt...

Can't format numbers for France in Excel 2003
I'm using the US version of Excel 2003, but need to format costs, etc., for a project in the French euro format (e.g., I need 2050.45 euros to display as 2 050,45). That currency format isn't offered in my dialog box, and if I make a custom number format that will display correctly, it doesn't operate as a number. Any suggestions? On Wed, 10 Oct 2007 08:51:03 -0700, Mary Fran <MaryFran@discussions.microsoft.com> wrote: >I'm using the US version of Excel 2003, but need to format costs, etc., for a >project in the French euro format (e.g., I need 2050.45 euros...

Query condition by date range
I'm trying to create a query to base a report from. I need it to return records within a date range that needs to be specified, as in specifying the beginning date and having the current date as the end date. A field is included in the query that has listed dates in the format mm/dd/yyyy. How would I write the criteria? I have part of it ready - [Please enter starting date:] . I know that's how you get the little question window. On Tue, 4 Dec 2007 14:51:00 -0800, silva wrote: > I'm trying to create a query to base a report from. I need it to return > records within a...

help 04-20-10
since yesterday when ever i try and open an icon on my desk top this message comes up windows cannot access the specified file, pathway you may not have permission to access it? what does this mean and how do i fix it???? Also about a week ago when i was on the internet these system messages kept coming up saying my computer was in trouble and peple were trying to access my personal information and i needed to upgrage my spyware. i couldnt go into any programes except the windows security site and then i had to buy the 6 month protection to access anything on my computer. now ...

Need help with conditional formula (Excel 97)
Can anyone give me the correct syntax for the following formula: if A1 is blank, and B1 is more than zero, then display B1, otherwise display nothing (blank cell) Thank you JD =IF(AND(A1="",B1>0),B1,"") Success! -- met vriendelijke groetjes "Jake D" <JakeD@djhtend.com> schreef in bericht news:crkto4lv30u7uujv27ek8okr0us5t9oj10@4ax.com... > Can anyone give me the correct syntax for the following formula: > > if A1 is blank, and B1 is more than zero, then display B1, otherwise > display nothing (blank cell) > > Thank you > > ...

Format cells #7
I have Excel 2000, Win ME. Recently the pulldown command to format cells does not always respond - ie, no box appears, so I can't apply borders or control number format. The shortcut approach doesn't work either. I've tried Help..Detect and Repair but the fault remains. Any suggestions welcome. ...

Conditional formatting if condition of an if statement is true and a string value is displayed
Dear Experts: I got a nested 'IF'-Formula in an excel cell that returns nothing if the condition is false. I would like to conditionally format this cell with grey shading if the condition is true and a string value is displayed. How can this be achieved using excel conditional formating functionality ? Help is much appreciated. Thank you very much in advance. Regards, Andreas Let's say your doing this conditional formatting in cell K17. In conditional formatting (xl2003) choose the FormulaIs: option and enter: =$K$17<>"" choose your formatt...

Formatting worksheet
I have a workbook with three worksheets and one chartsheet in it. I have notes documenting various aspects of the four sheets. Some of those notes are on electronic post-it notes and others on scraps of paper. It seems to me that a convenient way to consolidate all of my documentation for the workbook would be to add another worksheet to it and put the information in it. What would be the best way to format the worksheet so that I could type information into it as if I were using a text editor? Leslie, Excel isn't really all that set up for text. I sometimes make narrow column...

Micrsoft Project 03-04-10
You can link, you can link with lag, but how can I mirror(copy) a row on MS project onto another row? This is a multi-part message in MIME format. ------=_NextPart_000_0065_01CABBBD.4D886D40 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Office Virgin, Welcome to this Microsoft Project newsgroup :) Click on the ID number for the task so that the whole task is = highlighted. Then hold the Ctrl key and click and drag to an empty = space. You might like to have a look at my free series for beginners on = Microsoft...

Conditional Field in Queries
Is there a way to make a field in a query conditional so that it only displays the value if the value is equal to something specifically set? Thanks. Nick Nick.Korynski@gmail.com wrote: > Is there a way to make a field in a query conditional so that it only > displays the value if the value is equal to something specifically > set? Thanks. > > Nick Explain "the value is equal to something specifically set". -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com ...

zip codes not being saved as text in CSV format
I need my file to be saved in CSV format (to import into another application). When I format the zip codes as Text or Special(zip code), they are correct in XLS format, but when I open the file in CSV format they switch back to general. Any solution? work around? Thanks so much for your help in advance!! Melissa Change the file extension to .txt and use the text import wizard to treat the column as text (last dialog) -- Regards, Tom Ogilvy "MelissaM" <MelissaM@discussions.microsoft.com> wrote in message news:B5A02627-810E-4234-8247-267D9B12FA29@microsoft.com... >...

format a column
I have a simple question to ask, I have a column in Excel is number like 142000, I want to format the whole column numbers without the two ending 0s, change 142000 to 1420, how can I do that? Thanks -- xcao ------------------------------------------------------------------------ xcao's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=14538 View this thread: http://www.excelforum.com/showthread.php?threadid=471821 Enter 100 in an empty cell and copy it. Then, select your range of numbers you want to change, Right Click and go to Paste Special, and select Div...

How do i use Conditional formatting for 3+ conditions ?
I have a text box in a report which highlights in colour current members in a list of past and present member names. I have six types of current members that I want to highlight, but with conditional formatting I can only use 3 conditions in the members [Type] field. I have tried [Type]="Full member" Or "Life member" but the "Or" doesn't work ! Is there a way to do this ? thanks .. Roger CF is limited to 3 contitions, but you can use OR in those expressions. If you set Condition1 to Expression, you can use: ([Type] = "Full member") Or (...

How to return a 12 hour time format without the AM in an Access query
The format function acts differently in a query and after hours of testing, messing, and cursing, I give up. How do you return 12 hour format without the AM or PM from an Access query. In my table, I've defined the Start Time and End Time to use "Medium Time" format and it works if and ONLY if you simple include the field in the query. However, if you use the field in a more complex statement, it returns leading zeros and trailing seconds. Here's what I've tried.... 'This didn't work because it returns trailing seconds and AM/PM. '2:00:00 PM...

Help with Conditional formatting with Dates
Hi there, I have a spreadsheet in which I have to monitor various dates which are in different columns (i.e. (1) Date Tender Released, (2) Date Company Selected, (3) Date Draft Contract Forwarded, (4) Date Contract Signed etc...). Would if be possible to Conditional Format and have diffirent ROWs highlighted for each individual Contracts (I have 300 running contracts running) every time a date is filled in these different columns: Initial Step (1) = Yellow (Call for Tender released) Step (2) = Blue (Company Selected) Step (3) = Brown (Contract under Process) Step (4) = Green (Contract Si...

Conditional null value
Wondering if anyone can suggest a way to simplify the following code, which I’m using in the OnFormat event of a report. If Not IsNull(DLookup("[ICD2]", "EntryICDs", "[EntryNum] = " & Me! [PtAcct#])) Then Me![Field192] = Replace(DLookup("[ICD2]", "EntryICDs", "[EntryNum] = " & Me![PtAcct#]), ".", " ") End If If Not IsNull(DLookup("[ICD3]", "EntryICDs", "[EntryNum] = " & Me! [PtAcct#])) Then Me![Field194] = Replace(DLookup("[ICD...

Help
Forgive me if "Conditional Sums" is not the accurate word for what I am trying to accomplish... I'm at a loss for what to call this situation. What I have is a spreadsheet totaling attendance figures for classes taught by two people (Dave and Cary). Column A lists their name, and next to it in Column B is the number of people who attended that class. What I need is a formula that will look at the sheet and report in a given cell the total for attendance for each person. I can work basic formulas like SUM, but that will give the total for the entire column, when what I n...

Outlook 2003 03-19-10
I recently received an e-mail and when I printed same the 'subject' reference appeared as a Title Header also. Can anyone help in how you set-up this as thought it a good idea. The person who sent the email has a gmail account does that make a difference. I use Microsoft Outlook 2003. Thanks in advance. ...

Formatting Imported Data
Hi, I want to be able to read in a single column of data from either an Excel file or from a column of a word document and then produce the same column of data so that each entry has two cells separating them. So that the column 1 2 3 would look like 1 empty cell empty cell 2 empty cell empty cell 3 I there a straightforward way I can do this in Excel w/o having to use some type of additional program (like VBA)? TIA, Matt Nothing straightforward that I can see. Without some manual arranging which would be onerous, you will be better off to use a VBA macro. Sub InsertRows22() Appli...

XML Receipt and Conditions
I wanted to make a small adjustment to the receipt when a certain condition is met. If a particular word (eg. family) is typed into the comment on an item I wanted something slightly different to happen to the receipt I've just about got it, just stuck on the condition tag <IF> <CONDITION>len(Entry.Comment)</CONDITION> <THEN> I can get it using len but this makes it happen for any word, is there anyway I can make it so that it is more specific ie Entry.Comment contains '%family%' try <IF> <CONDITION>Entry.Comment like '%family%'&...

Time formats in Excel 2003
Being in the UK, I obviously want to use the English(UK) date format, so Christmas Day is 25/12/05 rather than 12/25/05. However, this defaults the time format to hh/mm/ss (why, I do not know, since I can assure American readers we're not normally that precise), so I have to reset it English(US) to get hh/mm, which resets the default date format to mm/dd/yy, so I have to change it back the next time I want to format a cell as a date. Any way round this? It's only a minor problem but it's irritating me. Steve Stephen, If you set up your own custom format with hh/mm, it w...

conditionally restricting values in excel
Hello, I want to restrict values in a particular column based on the value in other column. For eg. if column A has value int then column B should be restricted to values 1,2,3,4,5 if column A has value bool then column B should be restricted to values true and false. if column A has value string I dont want any validation to be done and the list box should not appear. Is this possible..... How do I achieve this ? Can I use macros to do this? How? Thanks Hi as a starting point: http://www.contextures.com/xlDataVal02.html >-----Original Message----- >Hello, >I want to restrict ...

office 10
I'm looking for a copy of Office 10 or something before that. Does anyone know where i could find it? Many thanks. jason In article <1191423571.962867.150020@22g2000hsm.googlegroups.com>, jason Zinoman <jason_zinoman@yahoo.com> wrote: > I'm looking for a copy of Office 10 or something before that. Does > anyone know where i could find it? Many thanks. jason A few suggestions: eBay, your local User Group, a Mac store. ...

Conditional formating condition..?
Hi All I have 2 CF conditions associated with a cell (C14), one of which is: Formula is =OR($C$4="Fred SOMEBODY",C14<>"10:30:00") What happens when this is true isn't important/relevant. The value in the cell appears as 10:30 (formatted as custom/hh:mm) but the value in the 'formula window' is actually 10:30:00. This type of condition works fine when the cell contains a simple number (or text) but I can't get it to work for either times or dates. I have tried it with and without the inverted commas (around the time value) and have tried using 10:30 ...