Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
SMac
 
Posts: n/a
Default Conditional Formating based on another cell

I have 2 columns of concern DATE and COST.
I would like the COST cell to be shaded if the DATE cell is less than a
specificed date.
Then if it is possible to calculate the COST field but only the ones
highlighted.

Help is greatly appreciated!!

Thanks, Stacey
  #2   Report Post  
Chad
 
Posts: n/a
Default

For the conditional format, use the following for the condition of the cost
column:

=$A$2<TODAY()
and so on, where cell A2 is the corresponding date column. Select the
appropriate shade on the pattern tab.

As far as calculating the cost column if it is highlighted, my only thoughts
are to write a macro that you can run that checks for all cost cells in the
column and performs the functions if the cell is shaded. Use an outside loop
that loops for all cells in the cost column with the following code inside:

If Range("B2").Interior.ColorIndex = 6 Then 'or whatever your shade color is
Range("B2").Formula = "hello" 'type whatever your formula is here
End If

Hope this helps!

"SMac" wrote:

I have 2 columns of concern DATE and COST.
I would like the COST cell to be shaded if the DATE cell is less than a
specificed date.
Then if it is possible to calculate the COST field but only the ones
highlighted.

Help is greatly appreciated!!

Thanks, Stacey

  #3   Report Post  
SMac
 
Posts: n/a
Default

I copied your formula and it worked but I want to enter a date i.e. 3/1/05
but it doesn't seem to work, I have: =$A$1<"3/5/05"
Where A1 is 3/8/05.

I will look into the macro.

Thanks!

"Chad" wrote:

For the conditional format, use the following for the condition of the cost
column:

=$A$2<TODAY()
and so on, where cell A2 is the corresponding date column. Select the
appropriate shade on the pattern tab.

As far as calculating the cost column if it is highlighted, my only thoughts
are to write a macro that you can run that checks for all cost cells in the
column and performs the functions if the cell is shaded. Use an outside loop
that loops for all cells in the cost column with the following code inside:

If Range("B2").Interior.ColorIndex = 6 Then 'or whatever your shade color is
Range("B2").Formula = "hello" 'type whatever your formula is here
End If

Hope this helps!

"SMac" wrote:

I have 2 columns of concern DATE and COST.
I would like the COST cell to be shaded if the DATE cell is less than a
specificed date.
Then if it is possible to calculate the COST field but only the ones
highlighted.

Help is greatly appreciated!!

Thanks, Stacey

  #4   Report Post  
Chad
 
Posts: n/a
Default

Use this: "=$A$1<DATE(2005,3,5)"

"SMac" wrote:

I copied your formula and it worked but I want to enter a date i.e. 3/1/05
but it doesn't seem to work, I have: =$A$1<"3/5/05"
Where A1 is 3/8/05.

I will look into the macro.

Thanks!

"Chad" wrote:

For the conditional format, use the following for the condition of the cost
column:

=$A$2<TODAY()
and so on, where cell A2 is the corresponding date column. Select the
appropriate shade on the pattern tab.

As far as calculating the cost column if it is highlighted, my only thoughts
are to write a macro that you can run that checks for all cost cells in the
column and performs the functions if the cell is shaded. Use an outside loop
that loops for all cells in the cost column with the following code inside:

If Range("B2").Interior.ColorIndex = 6 Then 'or whatever your shade color is
Range("B2").Formula = "hello" 'type whatever your formula is here
End If

Hope this helps!

"SMac" wrote:

I have 2 columns of concern DATE and COST.
I would like the COST cell to be shaded if the DATE cell is less than a
specificed date.
Then if it is possible to calculate the COST field but only the ones
highlighted.

Help is greatly appreciated!!

Thanks, Stacey

  #5   Report Post  
SMac
 
Posts: n/a
Default

GREAT! That worked.
Thanks!

"Chad" wrote:

Use this: "=$A$1<DATE(2005,3,5)"

"SMac" wrote:

I copied your formula and it worked but I want to enter a date i.e. 3/1/05
but it doesn't seem to work, I have: =$A$1<"3/5/05"
Where A1 is 3/8/05.

I will look into the macro.

Thanks!

"Chad" wrote:

For the conditional format, use the following for the condition of the cost
column:

=$A$2<TODAY()
and so on, where cell A2 is the corresponding date column. Select the
appropriate shade on the pattern tab.

As far as calculating the cost column if it is highlighted, my only thoughts
are to write a macro that you can run that checks for all cost cells in the
column and performs the functions if the cell is shaded. Use an outside loop
that loops for all cells in the cost column with the following code inside:

If Range("B2").Interior.ColorIndex = 6 Then 'or whatever your shade color is
Range("B2").Formula = "hello" 'type whatever your formula is here
End If

Hope this helps!

"SMac" wrote:

I have 2 columns of concern DATE and COST.
I would like the COST cell to be shaded if the DATE cell is less than a
specificed date.
Then if it is possible to calculate the COST field but only the ones
highlighted.

Help is greatly appreciated!!

Thanks, Stacey



  #6   Report Post  
SMac
 
Posts: n/a
Default

Chad,

How would I go about writing the code to looking for the shading and in turn
sum the cells that have it?

Thanks!
Stacey

"Chad" wrote:

For the conditional format, use the following for the condition of the cost
column:

=$A$2<TODAY()
and so on, where cell A2 is the corresponding date column. Select the
appropriate shade on the pattern tab.

As far as calculating the cost column if it is highlighted, my only thoughts
are to write a macro that you can run that checks for all cost cells in the
column and performs the functions if the cell is shaded. Use an outside loop
that loops for all cells in the cost column with the following code inside:

If Range("B2").Interior.ColorIndex = 6 Then 'or whatever your shade color is
Range("B2").Formula = "hello" 'type whatever your formula is here
End If

Hope this helps!

"SMac" wrote:

I have 2 columns of concern DATE and COST.
I would like the COST cell to be shaded if the DATE cell is less than a
specificed date.
Then if it is possible to calculate the COST field but only the ones
highlighted.

Help is greatly appreciated!!

Thanks, Stacey

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formating - cell protection Bdavis Excel Discussion (Misc queries) 0 February 11th 05 09:15 PM
Can you conditional format based on information in cell comments? Jflyer Excel Worksheet Functions 1 January 15th 05 01:52 AM
How to do a conditional formatting based on an adjacent cell Confused Excel Discussion (Misc queries) 2 January 10th 05 09:55 PM
cell formating based on value Carl Hilton Excel Worksheet Functions 3 January 9th 05 07:39 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"