In MS Excell... *EDIT: FIXED*

NathanBWF

Golden Member
May 29, 2003
1,810
0
0
Example:

I want B1 to equal the SUM of A1:A5 but add up only the numbers that have a red font color.

Can this be done with this fuction, or any function for that matter?
 

PowerEngineer

Diamond Member
Oct 22, 2001
3,600
775
136

I've never run into a way to access color information (font or background) for use in cell formulas.

You don't say how the numbers come to have different colored fonts. If it happens to be through formatting (e.g. red for negative numbers), then you might want to check out the CELL function. You might be able to set up a column of CELL-generated flags that SUMIF could use. If the colors are set through conditional formatting, then you should be able to set up a column of flags that mimic the conditonal formatting logic.

If the colors are set some other way, then your best bet might be a Visual Basic macro set to run on entry of numbers into the column.
 

NathanBWF

Golden Member
May 29, 2003
1,810
0
0
Originally posted by: WW
in vba

So here's another noob question, how/where do I create these VBA scripts? Can I just make them in notepad and save it with a .vba extension?

<---- Not a programmer
 

NathanBWF

Golden Member
May 29, 2003
1,810
0
0
Bah, just figured that out. Everything is working fine, except I need to figure out how to save the module. I have to re-enter it in everytime I close then re-open the file...