ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   sum total of numbers that are a certain color? (https://www.excelbanter.com/excel-worksheet-functions/245587-sum-total-numbers-certain-color.html)

nt

sum total of numbers that are a certain color?
 
I have a spreadsheet with numbers in every column and row with different
color fonts. I need to add up the numbers that are red, blue, green, etc.
For example:
A1 - 1.3 (red)
B2 - 1.5 (blue)
A5 - 1.0 (red)
D3 - 1.7 (blue)

I want cell A7 to add the red 1.3 + 1.0 and show me a total of 2.3 for red.
Then again in cell A8 to add the blue 1.5 + 1.7 and show a total of 3.2 for
blue.

I already have a colorfunction for counting the highlighted cell of a
certain color =ColorFunction($M$76,C7:AG73,FALSE) and this was working.
Until I tried adding another ColorFunction in a new vb module to SUM but the
cell that I've typed the formula in =ColorFunction($H$73,C7:AG73,TRUE) first
comes up with a Microsoft Visual Basic box: Ambiguous name detected:
ColorFunction and the cell has an error showing #NAME?. I'm not real smart
on formulas so I'm trying to learn, but the posts out there relating to this
question have confused me. I appreciate your time and patience. Thank you.
NT

Gary''s Student

sum total of numbers that are a certain color?
 
You are almost there. Just rename your new function to make it different
from the original.
--
Gary''s Student - gsnu200907


"NT" wrote:

I have a spreadsheet with numbers in every column and row with different
color fonts. I need to add up the numbers that are red, blue, green, etc.
For example:
A1 - 1.3 (red)
B2 - 1.5 (blue)
A5 - 1.0 (red)
D3 - 1.7 (blue)

I want cell A7 to add the red 1.3 + 1.0 and show me a total of 2.3 for red.
Then again in cell A8 to add the blue 1.5 + 1.7 and show a total of 3.2 for
blue.

I already have a colorfunction for counting the highlighted cell of a
certain color =ColorFunction($M$76,C7:AG73,FALSE) and this was working.
Until I tried adding another ColorFunction in a new vb module to SUM but the
cell that I've typed the formula in =ColorFunction($H$73,C7:AG73,TRUE) first
comes up with a Microsoft Visual Basic box: Ambiguous name detected:
ColorFunction and the cell has an error showing #NAME?. I'm not real smart
on formulas so I'm trying to learn, but the posts out there relating to this
question have confused me. I appreciate your time and patience. Thank you.
NT


nt

sum total of numbers that are a certain color?
 
Do you mean type in something like ColorSum instead of ColorFunction in the
VB module??

"Gary''s Student" wrote:

You are almost there. Just rename your new function to make it different
from the original.
--
Gary''s Student - gsnu200907


"NT" wrote:

I have a spreadsheet with numbers in every column and row with different
color fonts. I need to add up the numbers that are red, blue, green, etc.
For example:
A1 - 1.3 (red)
B2 - 1.5 (blue)
A5 - 1.0 (red)
D3 - 1.7 (blue)

I want cell A7 to add the red 1.3 + 1.0 and show me a total of 2.3 for red.
Then again in cell A8 to add the blue 1.5 + 1.7 and show a total of 3.2 for
blue.

I already have a colorfunction for counting the highlighted cell of a
certain color =ColorFunction($M$76,C7:AG73,FALSE) and this was working.
Until I tried adding another ColorFunction in a new vb module to SUM but the
cell that I've typed the formula in =ColorFunction($H$73,C7:AG73,TRUE) first
comes up with a Microsoft Visual Basic box: Ambiguous name detected:
ColorFunction and the cell has an error showing #NAME?. I'm not real smart
on formulas so I'm trying to learn, but the posts out there relating to this
question have confused me. I appreciate your time and patience. Thank you.
NT


nt

sum total of numbers that are a certain color?
 
Worked! Thank you for your help!
NT

"NT" wrote:

Do you mean type in something like ColorSum instead of ColorFunction in the
VB module??

"Gary''s Student" wrote:

You are almost there. Just rename your new function to make it different
from the original.
--
Gary''s Student - gsnu200907


"NT" wrote:

I have a spreadsheet with numbers in every column and row with different
color fonts. I need to add up the numbers that are red, blue, green, etc.
For example:
A1 - 1.3 (red)
B2 - 1.5 (blue)
A5 - 1.0 (red)
D3 - 1.7 (blue)

I want cell A7 to add the red 1.3 + 1.0 and show me a total of 2.3 for red.
Then again in cell A8 to add the blue 1.5 + 1.7 and show a total of 3.2 for
blue.

I already have a colorfunction for counting the highlighted cell of a
certain color =ColorFunction($M$76,C7:AG73,FALSE) and this was working.
Until I tried adding another ColorFunction in a new vb module to SUM but the
cell that I've typed the formula in =ColorFunction($H$73,C7:AG73,TRUE) first
comes up with a Microsoft Visual Basic box: Ambiguous name detected:
ColorFunction and the cell has an error showing #NAME?. I'm not real smart
on formulas so I'm trying to learn, but the posts out there relating to this
question have confused me. I appreciate your time and patience. Thank you.
NT



All times are GMT +1. The time now is 06:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com