Is there a way to SUM based on formatting of a number?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a column of $ formatted numbers. Some of them are bold and the others
are not. I would like to Sum the column based on whether the bold formatting
is applied or not. Is there a way to do this? (doesn't appear to be)

If there isn't, then let me explain what I am looking for ultimately. I want
to have two totals for this column of $. One that includes everything and one
that includes everything that isn't "marked". Bolding a cell is a really easy
and visual way of marking a cell. Is there some other way I could mark a cell
and is visible and I can conditionally sum the values?

Thanks,
Tim
 
You could sum based on formatting if you use VBA, Chip Pearson has some VBA
functions that will sum based on cell color here

http://www.cpearson.com/excel/colors.htm

If you search Google you should be able to find some VBA solutions to "sum
bold fonts"

--
Regards,

Peo Sjoblom

(No private emails please)
 
timz said:
I have a column of $ formatted numbers. Some of them are bold and the others
are not. I would like to Sum the column based on whether the bold formatting
is applied or not. Is there a way to do this? (doesn't appear to be)

If there isn't, then let me explain what I am looking for ultimately. I want
to have two totals for this column of $. One that includes everything and one
that includes everything that isn't "marked". Bolding a cell is a really easy
and visual way of marking a cell. Is there some other way I could mark a cell
and is visible and I can conditionally sum the values?

Thanks,
Tim
A simple function could be

Function BoldSum(rng)
Dim c
For Each c In rng
If c.Font.Bold Then
BoldSum = BoldSum + c.Value
End If
Next

End Function

Copy function into VB Module and use within the book.

Peter Atherton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top