Need running total formula based on adjacent column text color

chad7469

New Member
Joined
Sep 25, 2014
Messages
1
I need to create a running total based on the color of the text in an adjacent column. I am using 2007 Excel. Essentially, every time I enter a date in "black" text, I need the count to go up by "one"; every time I enter a date in "red" text, I need the count to go down by "one". I need the column titled "Net 15 Rule" to contain the running total, based on the color of the date, as depicted below.

Original DateNet 15 Rule
8/29/20121
9/2/20122
9/5/20121
9/9/20122
9/10/20123
9/15/20124
9/18/20123

<tbody>
</tbody>



I apologize if I did not format my question properly or use correct terminology, I am rather new to Excel. If you need further information to answer my question, please let me know.

Thanks for any help!!!!!!!!!!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Have a look at this .... (this code is to be inserted in the command button)

Code:
Private Sub CommandButton1_Click()
    
   Range("A3").Select
   
   Do While ActiveCell.Value <> ""
        If ActiveCell.Font.ColorIndex = 3 Then                                           'if font colour of date is red
            ActiveCell.Offset(0, 1).Value = ActiveCell.Offset(-1, 1) - 1
        Else                                                                                            'if font colour of date is black
            ActiveCell.Offset(0, 1).Value = ActiveCell.Offset(-1, 1) + 1
        End If
        
        ActiveCell.Offset(1, 0).Select
   Loop
   
End Sub



view
<---- Click on image


Note that the loop starts at "A3" BUT you can change it depending on your starting range and you don't have to complete the rest of the entries under "Net 15 Rule". The macro does this

Hope this helps ?



I need to create a running total based on the color of the text in an adjacent column. I am using 2007 Excel. Essentially, every time I enter a date in "black" text, I need the count to go up by "one"; every time I enter a date in "red" text, I need the count to go down by "one". I need the column titled "Net 15 Rule" to contain the running total, based on the color of the date, as depicted below.

Original DateNet 15 Rule
8/29/20121
9/2/20122
9/5/20121
9/9/20122
9/10/20123
9/15/20124
9/18/20123

<tbody>
</tbody>

I apologize if I did not format my question properly or use correct terminology, I am rather new to Excel. If you need further information to answer my question, please let me know.

Thanks for any help!!!!!!!!!!
 
Upvote 0

Forum statistics

Threads
1,215,654
Messages
6,126,048
Members
449,282
Latest member
Glatortue

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top