Conditional formating a group of values

Kyndsberg

New Member
Joined
May 5, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Dear fellow Excel users

I'm trying to do conditional formating on a set of data. I want the background of the cells to reflect which cells belong together.


1683289437828.png


In the above example I want to switch between having a background colour and no background colour everytime the sum adds to zero.

The purpuse is to show which registrations are connected visually.

Any ideas? I'm trying match with indirect and row numbers based on the sum, but I'm still not getting quit getting the excact idea how to solve this.

Best regards
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
MrExcelPlayground17.xlsx
ABCD
1DateThingTransactionRunning Sum
21/1/2023a$10,000$10,000
31/2/2023b$1,000$11,000
41/3/2023c-$6,000$5,000
51/4/2023d$1,000$6,000
61/5/2023e-$6,000$0
71/6/2023f$100,000$100,000
81/7/2023g-$25,000$75,000
91/8/2023h$10,000$85,000
101/9/2023i-$85,000$0
111/10/2023j$5,000$5,000
121/11/2023k-$5,000$0
131/12/2023l$8,500$8,500
141/13/2023m$7,500$16,000
151/14/2023n-$16,000$0
Sheet6
Cell Formulas
RangeFormula
A3:A15A3=A2+1
D2D2=C2
D3:D15D3=C3+D2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:D15Expression=ISEVEN(COUNTIF(D1:D$2,0))textNO
 
Upvote 0
Solution
MrExcelPlayground17.xlsx
ABCD
1DateThingTransactionRunning Sum
21/1/2023a$10,000$10,000
31/2/2023b$1,000$11,000
41/3/2023c-$6,000$5,000
51/4/2023d$1,000$6,000
61/5/2023e-$6,000$0
71/6/2023f$100,000$100,000
81/7/2023g-$25,000$75,000
91/8/2023h$10,000$85,000
101/9/2023i-$85,000$0
111/10/2023j$5,000$5,000
121/11/2023k-$5,000$0
131/12/2023l$8,500$8,500
141/13/2023m$7,500$16,000
151/14/2023n-$16,000$0
Sheet6
Cell Formulas
RangeFormula
A3:A15A3=A2+1
D2D2=C2
D3:D15D3=C3+D2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D2:D15Expression=ISEVEN(COUNTIF(D1:D$2,0))textNO
Dear James Canale

Thank you so much - that's very clever.

I've never come across the "Is Even" function. I had to 'figgle' with it for a bit to understand what it's actually doing - that is very creative. Simply counting the total amount of zeros and every other zero will - off course - be an even number. It's exactly what i needed.

Have a nice day.

Kasper
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

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