ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formating a row based on one cell's date (https://www.excelbanter.com/excel-worksheet-functions/446589-formating-row-based-one-cells-date.html)

Tee51

Formating a row based on one cell's date
 
Hello,

I'm working on a spreadsheet that has columns A - G. Column A has the dates. I would like to create a format that will highlight the entire row if column A has a date within the past 7 days. In my example for of the rows should be highlighted. I was able to find formulas that only worked on one cell. Can someone help me with this? PLEASE & THANK YOU!


**Example**
7/17/12 DEA MA ACCT CONT Closed
7/13/12 HHI MA ACCT CONT Closed
7/10/12 MMG MA ACCT CONT Closed
7/16/12 ABC P ACCT CONT Closed
7/13/12 TAL W ACCT CONT Closed
7/20/12 HOK P ACCT CONT Closed

Spencer101

1 Attachment(s)
Quote:

Originally Posted by Tee51 (Post 1603713)
Hello,

I'm working on a spreadsheet that has columns A - G. Column A has the dates. I would like to create a format that will highlight the entire row if column A has a date within the past 7 days. In my example for of the rows should be highlighted. I was able to find formulas that only worked on one cell. Can someone help me with this? PLEASE & THANK YOU!


**Example**
7/17/12 DEA MA ACCT CONT Closed
7/13/12 HHI MA ACCT CONT Closed
7/10/12 MMG MA ACCT CONT Closed
7/16/12 ABC P ACCT CONT Closed
7/13/12 TAL W ACCT CONT Closed
7/20/12 HOK P ACCT CONT Closed

Hi,

Is this what you mean?

You use conditional formatting and lock the column using $ in the formula.

Have a look at the conditional formatting rule to see what I mean.

Tee51

Thanks for the response but I'm looking for one rule instead of two.

Spencer101

Quote:

Originally Posted by Tee51 (Post 1603715)
Thanks for the response but I'm looking for one rule instead of two.

That is one rule... but with an AND statement...

You could use =$A1=TODAY()-6 but that will also highlight rows with dates in the future.

Tee51

I made a change to the "applies to" field now everything works perfectly....I have more last question. If I wanted to use the same rule but only highlight rows that had a status other than 'CLOSED' how would I go about it?

Spencer101

Quote:

Originally Posted by Tee51 (Post 1603717)
I made a change to the "applies to" field now everything works perfectly....I have more last question. If I wanted to use the same rule but only highlight rows that had a status other than 'CLOSED' how would I go about it?

Amend the same formula, to include it. You'd need to use AND for that.

=AND($A1=today()-6,F1<"Closed")

Change F to whichever column your "Closed" is recorded in if not F.

Hope that helps.

Tee51

Quote:

Originally Posted by Spencer101 (Post 1603718)
Amend the same formula, to include it. You'd need to use AND for that.

=AND($A1=today()-6,F1<"Closed")

Change F to whichever column your "Closed" is recorded in if not F.

Hope that helps.

When using =AND($A1=today()-6,F1<"Closed"), the format changes...see attached.

Tee51

1 Attachment(s)
Quote:

Originally Posted by Tee51 (Post 1603719)
When using =AND($A1=today()-6,F1<"Closed"), the format changes...see attached.

File attached

Spencer101

Quote:

Originally Posted by Tee51 (Post 1603720)
File attached

Sorry, my bad. Put a $ before the F too...

Tee51

Quote:

Originally Posted by Spencer101 (Post 1603721)
Sorry, my bad. Put a $ before the F too...

The current formula is highlighting 7 days before and after today. Is there anyway to highlight only 7 days before?

Spencer101

Quote:

Originally Posted by Tee51 (Post 1603723)
The current formula is highlighting 7 days before and after today. Is there anyway to highlight only 7 days before?

Just add another condition to the AND....

=AND($A1=TODAY()-6,$A1<=TODAY(),$F1<"Closed")

Tee51

Quote:

Originally Posted by Spencer101 (Post 1603724)
Just add another condition to the AND....

=AND($A1=TODAY()-6,$A1<=TODAY(),$F1<"Closed")

Thanks for your help!

Spencer101

Quote:

Originally Posted by Tee51 (Post 1603731)
Thanks for your help!

Not a problem. Happy to help.


All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com