Color Cells Based On Difference In Months Of Dates

May 14, 2008

I have dates in Column D (mm/dd/yyyy). I'm trying to write a macro to compare the date in any cell in Column D to the current date. Then, if the date in that cell is within a month of the current date, color it red. If the date is within two months, color it orange. Etc, for up to six months. I've read up a little on dates in VBA, but I'm pretty lost.

View 4 Replies


ADVERTISEMENT

Difference In Months Between 2 Dates

Sep 27, 2007

say C2= 22/02/2007. in cell C4 When I use this formula =TODAY()-C2 to get the difference between today and a past date the result the formula give is 07/05/1900
i would like to receive the difference in Months between the past date and today? I.E. HOW MANY MONTHS IN BETWEEN

View 4 Replies View Related

Find The No. Of Months Between The Difference Of 2 Dates?

Feb 21, 2009

what is the formula to convert the date in MMYYYY into some numbers so that I can derive the difference between 2 dates?

For example:
I have 2 dates 31-Jan-09 and 28-Nov-05 in Column A & Column B respectively. I would like to derive no. of months between the difference of the 2 dates which in this case is 38 months.

View 9 Replies View Related

Calculating Difference In Months Between Dates / Ignoring Days And Years?

Mar 13, 2012

Cell A1 contains 02/29/2012

Cell B1 contains 12/01/2006

I am looking for a formula that will return the number of months (periods) between two dates, ignoring days and years. Using the above dates, which cannot be changed, the result needs to be 63. The formulas I have tried keep returning 64 because my later date is at the end of a period, and my earlier date is at the beginning.

View 7 Replies View Related

Color Cells Based On Difference Between Two Cells

Jun 3, 2008

I have a 2 lists of manually entered values where the values in each row are related. They are related in the sense that if the difference between them is equal to or less than, a given amount then the cell containing one value is colored Blue. e.g.

COl A holds Value x while COl B holds value y. I need to check which value is entered in columns A and B and if a given difference or greater exists colour the cell in COl B. For example the relationship relevant to a COL A value of 21.0 is 11.0.

So, I enter the following;

A1 B1

21.0 13.0 <----------------No color Blue

I enter new values

21.0 9.5 <----------------B1 is blue.........................

View 2 Replies View Related

Automatically Create Columns Based On Difference Between Two Dates

May 2, 2008

I have been perusing various Excel sites in hopes of finding a macro or function that can create columns based upon two dates input into specific cells. My ultimate goal is to use this macro or automated function so that when the user inputs the dates, the columns would automatically be created for them, rather than having them do it manually.

ideally, the 'start' and 'finish' dates are named cells and the macro could determine the difference between the two and automatically insert columns to the left of a ' Totals' column.

View 9 Replies View Related

Conditional Format - Dates Greater Than 18 Months And 24 Months?

Dec 6, 2013

I have a date column (Column E: Date Entered) on my spreadsheet that I need to set conditional formatting on. There are two conditions:

1) 18 months from the date in the cell needs to be highlighted yellow

2) 24 months from the date in the cell needs to be highlighted red

View 6 Replies View Related

Calculate Percentage Of Individual Months Between 2 Dates And Populate Different Cells With Results

Dec 20, 2013

I want to display the percentage of occupancy for each month for condo rentals.

I have columns with dates that represent bookings throughout the year. check in and check out dates to be more precise. (A1 and B1 for example) and I have columns with months Jan, Feb, etc. (C1, D1, etc. for example)

The problem I run in to is that I can calculate the number of days between the dates and the fraction of the year (*12 to get a monthly value, but I fail to understand how I can break that up so that I can populate each month with a correct percentage of the total term.

E.g. A1=1-jan-2014 and B1=20-jan-2014 is an easy one because it only covers 1 month:
formula: =(YEARFRAC(A1,B1,3))*12 gives me 62,47% which I could just use as is for that month.

So far so good, but when the period covers more than one month or when the months overlaps, I don't know how to break the outcome up into the appropriate months to display the correct percentage for each month in its own column.

e.g. A1=1-jan-2014 and B1=20-Mar-2014 gives me a result of 253% with the same formula.
100% for November, 100% for December and 63% for January, which I could somehow formulate to break up over different Months.

But then it gets more tricky. What if the booking starts on a day other than the 1st of the Month?

e.g. A1=5-jan-2014 and B1=20-Mar-2014
The result of the formula (243%) is correct, but isn't sufficient to put the correct percentages for each month in their respective column.

What formula(s) should I use to break down the percentages to match the correct fraction of each individual month?

I attached an example of what I have so far for your review : test.xlsx‎

View 8 Replies View Related

Display Th % Difference Of The 2 Months Either In The Chart Or In A Table

Mar 16, 2009

I am using a stacked Data chart with Layout #5. See attached. I calculated in a table below the % difference between the 2 months, but is there a way to display this % difference of the 2 months either in the chart or in a table (or both)?
Is there a way to modify the table only? Or is there a different type of chart that can display this?

View 5 Replies View Related

Color Column Charts Based On Font Color Data Cells

Oct 27, 2009

I have attached the relevant spreadsheet for which I need to alter the color of the columns based on Site number ( Sheet 1). % Mortality will be represented in the Y-Axis, and the Site numbers would be on the X-Axis. All columns (% Mortality) except one will be of the same color, and the one of a different color will indicate a specific site. As an example, site 86 is colored differently. The way I require the chart to look is shown on Sheet 1.

After reading through some great posts on Ozgrid, I managed to do this using conditional formatting (Sheet 2), but that sort of falls short because I am required to add a data table to the chart, and the parameter that is indicated by the column bars happens to appear twice in the data table.

I was wondering if this can be automated maybe using VBA, but with the possibility of simply matching the color of columns with the font color of respective entry in the data series.

View 9 Replies View Related

Color Cells Based On Color Of Preceeding Cell

Nov 18, 2007

I am looking for a very simple script that will achieve the following:

On the clicking of a button, Select and shade in a cell yellow, delete the yellow shading of the previous cell. The shading & selection should move up a column of cells, 1 at a time, in the following order:

From B10 to B9, then B9 to B8, B8 to B7 etc until the selection and shading is at B2. Once it is at B2 subsequent clicks will simply keep it at B2 (the top). Thus after 8 clicks the shading & selection should travel from B10 to B2, with only 1 cell being shaded yellow and selected at any one time.

View 5 Replies View Related

Macro To Color Cells Based On Their Font Color

Jun 18, 2008

I have a spreadsheet that i download from the net daily, which is seperated into columns of information.

I want to be able to look down a column and mark a cell in a seperate column if the cell font text is red.

For example looking down column A ... if the font text of a1 is red then mark the cell background colour of T1 red - if a2 text colour is red then mark the cell T2 red .... etc etc.

If the font colour in a1 or a2 ... etc etc is any other colour then do nothing.

I have 5 columns I wish to look down and mark in 5 seperate columns - I have tried to do this by conditional formating but don't know the fomula for checking font colour.

View 9 Replies View Related

Change Cell Color Based On A List Of Dates

Oct 30, 2013

I am having an excel sheet where I enter the delivery dates. There are few freezes and restricted dates.

When I am entering the delivery date which falls under the freeze or restricted date, the colour of that cell should change.

How to achieve this either using some macro.

View 4 Replies View Related

Apply Color Coding To Dates Based On Conditioning

Aug 1, 2007

Im working on a large workbook with multiple worksheets. Each of these
worksheets has a large amount of data relating to training records. In
particular, the date that an employees certification is due to expire
(eg: 01/02/2007 or 31/09/2009 etc)...(im also in Australia so my date formats may be different).

I need to color code these records with the below logic, eg:

If Cell Date is <Today() = Red Text or Cell
If Cell Date is <18months from Today()+1 = Yellow Text or Cell
If Cell Date is >18months from Today() = No change - leave white

I have basic VBA knowledge, but will be able to work my way through
some of the code that is posted.

It's also key to note that there are multiple 'Blank' and 'Text' Cells
in these worksheets. I only want to apply this code to a cell if it is
populated with a date, is this possible ?? (eg: i only want to change
the color of the dates listed, not the other cells with text and single
numbers).

I have played around with the Conditional Formatting but i will need
more than 3 conditions in the future. I've also attached a small
screenshot of the data for your convenience.

View 14 Replies View Related

Color Cells Housing Dates

Jan 9, 2008

I have 4 cells in a single row. I would like the first 3 cells to contain various data for assigned tasks to employees. The 4th cell will contain a date, but that date will only be inserted once the task has been completed. The behavior of the cells over time needs to look like this:

1. The first 3 cells must have text in them and remain with white backgrounds until the date is inserted in the 4th cell.
2. All 4 cells must turn gray once the date is inserted in the 4th cell.

A user on another forum gave me Cell Value is Not Equal to ="" as the answer. This does not work as I have text in the first 3 cells and need them to remain white until the date is inserted in the 4th cell. Using "Formula Is" makes more sense to me as an approach, but I'll be hog-tied if I can figure out how to write the formula for it.

View 8 Replies View Related

Cells' Color Change Depending On Dates

Aug 24, 2009

I have column "C", starting from "C5" with dates till C200, but not all cells have dates some of them are also blank.

I want the cell to change color depending on the date.

If the written due date is in a month from today, I want it to turn yellow, and if the due date is in the past from today, I wanted to turn red. I want it to get updated every month.

View 9 Replies View Related

Conditional Formatting Based On Difference Value Between Figures In Two Cells?

Apr 10, 2014

I would like to use conditional formatting to mark cells with arrows depending on the difference between the values in those cells and figures from different cells. Namely, I have percentage values in column A and B. I need cells in column B to be marked with arrows (up, right or down) when the difference between value B and A is bigger than 2%, bigger than 0 but smaller than 2%, and smaller than 0 respectively (see the spreadsheet attached).

View 2 Replies View Related

Formula To Find Two Cells Based On Dropdown List And Then Workout Difference?

Jun 5, 2014

I have a list of Names that has numbers accumulated over months. I am looking for a formula to use in a search tool that uses a drop down list to identify the name I am looking for and then the formula will show me the increase that happened in certain months.

See the attachment the result is coming from Denominators tab, I want the answer displayed in the Display tab, you will see a drop down list at C3 in Display, I am trying to show the answer in cell D9-I9.

how many the denominator has increased in that month. so for D9 it will come from denominator tab column c minus b, E9 will be d minus c

View 9 Replies View Related

Color Cells Based On Adjacent Cells Being Empty & Add Text

Apr 2, 2008

I’m trying to make my life a bit easier, by adding a few macros and formulas to the spreadsheet (Everything was done completely manually before I got here!!!).
What I would like to do is take two columns, which contain a start and end time for work shifts, and colour them GREEN once I have entered a name in the Worker column (Along side the two with the time), and also to fill a cell with a Yes or a No. I’m aware of auto conditioning, and I’ve tried to have a play to get this to work, but I just can’t work it out.
I have posted a link to an image which shows what I want. I hope I've explained it well enough!

http://img530.imageshack.us/img530/6239/excelspfk0.jpg

View 9 Replies View Related

Fill Cells Color In Worbook Based On Other Cells

Jan 27, 2005

how can I automatically fill cells with certain colors based on the value of the cell. (i.e. I want to search an entire workbook and fill cells with values between 80 and 99 green, 60 to 79 yellow and 0 to 59 red.)

View 9 Replies View Related

Color Cells Based On Multiple Conditions Of Different Cells

Jan 15, 2008

I’m trying to change color in cell B9 according to different conditions in Cell C9 (than on b10 according to c10 and so long until necessary - probably will be around 2000 lines). Since there are more than 3 conditions and in two cases condition depends on the color of the C Column, I can not use conditional formatting. I’ve searched and found similar forums here, but since I’m ignorant in VBA code, I couldn’t manage to make adjustments. So if you can help me with the code, I would really appreciate it!

Condition and Results required would be:

IF column C = “S” than on Column B = color cell light blue with white border
IF column C = “P” than on Column B = color cell Green with white border
IF column C = “A” than on Column B = color cell Yellow with white border
IF column C = “L” than on Column B = color cell Red with white border
IF column C = “C” than on Column B = color cell Dark Blue with white border
IF column C = “ ” than on Column B = color cell white
IF column C = “V” and has white background than on Column B = color cell white
IF column C = “V” and has a Dark Grey background than on Column B = color cell Dark Grey

I don’t know if the last two are feasible.

View 6 Replies View Related

Finding Months Between Two Dates?

Dec 23, 2013

finding a formula to calculate the number of months between two dates. I've attached an Excel spreadsheet with sample data. Some are in the future, and some are in the past.

Excel Help.xlsx

View 9 Replies View Related

Using Dates And Months In IF Statement?

Aug 10, 2014

I was wondering if this can be done we have a monthly award program so if a date was entered for that drive on this month it would = no if blank =yes but needs to reset each month?

=IF(AND('Driver'!A51:A1000)="",IF('Driver'!A51:A1000>='Driver Bonus'!A3,"YES","NO")) This brings back a #value! error

=IF(AND('Driver'!A51<=A3,'Driver'!A51>=A3),"NO","YES") this works but only for that cell i need to also recognize cells A51:A1000

=IF(MAX(INDIRECT("'"&A8&"'!A51:A1000"))<A3+1,IF(MAX(INDIRECT("'"&A8&"'!A51:A1000"))<>A3,"YES","NO")) this also works but only for 1 day

View 4 Replies View Related

Years And Months Between Two Dates

Aug 7, 2009

The issue is i want years and months between two dates which are not in computer language. Date like 2008/12 and 2010/01. File is attached for you reference

View 2 Replies View Related

Grouping Dates Into Months?

Feb 27, 2013

I have a table with model numbers as column A, and Row 1 contains dates, each columns contains net sales, my question is there any simple way to group all dates into months and years, i have tried using a pivot and it doesnt work correctly Screenshot (1).png

View 2 Replies View Related

Months That Occur Between Two Dates

Jan 13, 2010

I would like a formula (if it is possible) that will list which months occur between two dates;

i.e
Start Date (Cell ref A2) = 01/01/2010 (in the dd/mm/yyy format)
End Date (A3) = 02/05/2010

In cells D2:O2 I have the months Jan-Dec. In cells D3:O3 I would like a "Yes" to appear if the above month occurs between the dates in A2 & A3. In this example would like a "Yes" to appear in cells D3, E3, F3, G3 & H3 but not in the other 'Months' appropriate cells.

View 2 Replies View Related

Counting Months Between 2 Dates

Oct 7, 2011

I need a formula to count the months (including part months) between 2 dates.

So i want 01/04/11 to 5/5/11 to equal 2

I have tried a few formulas that get the answer 1 but i need it to count the part month too.

View 2 Replies View Related

Count Dates Less Than 3 Months Old

Nov 28, 2013

I have a column of dates, and wanted to count how many of them are within 3 months of todays date.

I wrote this obvious formula, or so I thought, as it displays zero results, when here should be loads.

=COUNTIF(A:A,>(TODAY()-90)")

View 3 Replies View Related

Years & Months Between Two Dates

Apr 12, 2007

Which formula should I use to return years and months between two dates.

4/1/05 7/30/25

View 2 Replies View Related

Calculate Months Between Dates

Aug 21, 2007

I am building a template to auto populate budget value by straight line based on task start/end date criteria. some tasks could give me correct duration distribution, but some don't. I am looking for If function, which could give me correct monthly allocation budget. Here is an example of what I am trying to achieve. task 0110 duration is from 09/15/07 to 05/24/08, duration month is 8. budget $34,465supposed to be allocated to 8 month starting from Sept, 07. but my if logic return 9 month instead.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved