RaulSan

New Member
Joined
Dec 13, 2015
Messages
3
Dear friends,

Is there any formula or VBA Code that allows me to subtotal a group of cells based on their cell background color but as enlisted in the "Desired formula" column as follows:

D4 Subtotals D5:D8
D5 Subtotals D6
D7 Subtotals D8

D6 And D8 Are data captured manually

Thanks a lot i hope this is easy to understand.

Thanks in advance.
Cell
C
D
E
Reference
Code
Amount
Formula (Using Cell Reference)
Description
Cell Color
Desired Formula
4
1
20.00
=SUBTOTAL(9,D5:D8)
Second Subtotal (Range: 1:1 to 1.2.1)
Cell Color: Yellow
Subtotal til the next yellow cell
5
1.1
10.00
=SUBTOTAL(9,D6)
First Subtotal (Range 1.1.1)
Cell Color: Green
Subtotal til the next green cell
6
1.1.1
10.00
DATA INPUT
Data Captured Manually
Cell Color: No Color
No formula
7
1.2
10.00
=SUBTOTAL(9,D8)
First Subtotal (Range 1.2.1)
Cell Color: Green
Subtotal til the next green cell
8
1.2.1
10.00
DATA INPUT
Data Captured Manually
Cell Color: No Color
No formula
9
2
20.00
=SUBTOTAL(9,D10:D13)
Second Subtotal (Range: 2.1 to 2.2.1)
Cell Color: Yellow
Subtotal till the next yellow cell
10
2.1
10.00
=SUBTOTAL(9,D11)
First Subtotal (Range 2.1.1)
Cell Color: Green
Subtotal til the next green cell
11
2.1.1
10.00
DATA INPUT
Data Captured Manually
Cell Color: No Color
No formula
12
2.2
10.00
=SUBTOTAL(9,D13)
First Subtotal (Range 2.2.1)
Cell Color: Green
Subtotal til the next green cell
13
2.2.1
10.00
DATA INPUT
Data Captured Manually
Cell Color: No Color
No formula
Grand Total
40.00

<tbody>
</tbody>
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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