counting colored cells

ndello

Active Member
Joined
Oct 16, 2002
Messages
382
Hi all,
I am using cells A15 through Z 100
I color code cells and want to add the totals. So in Cell A1 I want the total of all green colored cells. A2 I want the total of red, etc.
One caveat, I merge cells all throughout A15 to Z100, so I only want to count the colored cell once not each one within the merge.

Any chance on a formula for that?

Thanks so much
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
First piece of advice -- get rid of the merged cells! They will cause you nothing but grief!
They are one of the biggest headaches in Excel, and most serious users won't touch them with 10 foot pole.
You can achieve the same visual effect without all the issues by using the "Center Across Selections" format option, as explained here: Tom’s Tutorials For Excel: Using Center Across Selection Instead of Merging Cells – Tom Urtis

Second, how exactly are your cells being colored?
If they are being colored by Conditional Formatting, you may be able to use the same conditions you are using for that in a SUMIF or SUMIFS formula (sum by the same conditions you are doing the Conditional Formatting on).

If they are being colored manually, you will need to use VBA, as Excel functions only run off of cell values, not cell formatting.
Here is a link that shows you how to do that: Sum by color using VBA in Microsoft Excel
 
Upvote 0
Solution
Thanks and silly question, where do i find center across selection, I just searched the whole ribbon (no doubt I missed it)
I cannot use conditional,
 
Upvote 0
Thanks and silly question, where do i find center across selection
Select the range.
Right-click on it.
Select "Format Cells"
Go to "Alignment" tab.
It is under the "Horizontal" drop-down box.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,377
Members
448,955
Latest member
BatCoder

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