View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default SUM of column based on format criteria

Hi,

there is no inbuilt finction for SumBold you have to write one so try this

Alt+F11 to open VB editor. Right click 'This Workbook' and insert module and
paste the code below in

call with =SumBold(A1:A20)

Note that simply bolding a cell won't cause the worksheet to recalculate so
refresh the formula with F9 when bolding a cell

Function SumBold(rng As Range) As Variant
Application.Volatile
For Each c In rng
If IsNumeric(c) And c.Font.Bold Then
SumBold = SumBold + c.Value
End If
Next
End Function

Mike

"SRN" wrote:

I need to sum a column which has a series of dollar amounts, some the same,
but only include numbers once they have been made bold. eg

23.50
67.80 (Bold format)
99.45
88.23
23.50(Bold format)
22.45
88.23
19.00

In the above example the sum would be only of numbers with bold format. What
would e the formula to do that

Thanks

SRN