Sum of the bold numbers
ific
-
Gord21 Posted messages 928 Status Member -
Gord21 Posted messages 928 Status Member -
Hello,
I am at the bottom of the programming ladder, and I can't seem to write the formula that would allow me to sum the amounts written in bold in a column. I put =SUMIF(C4:C58, "bold")???
If anyone can help me, thank you in advance!!
I am at the bottom of the programming ladder, and I can't seem to write the formula that would allow me to sum the amounts written in bold in a column. I put =SUMIF(C4:C58, "bold")???
If anyone can help me, thank you in advance!!
Configuration: Windows XP Firefox 3.5.5
2 answers
-
Hello,
I don't know of any Excel function that can indicate if the text is bold or not, but you can try this macro (the recalculation is not automatic; you need to press F9 if you change the formatting of a source cell):
Function Sum_bold(Data_range As Range)
Dim sum As Double
Dim cell As Range
sum = 0
For Each cell In Data_range
If (IsNumeric(cell.Value) And (cell.Font.Bold)) Then
sum = sum + cell.Value
End If
Next cell
Sum_bold = sum
End Function -
Good evening,
Apparently, you are new to macros. For your information, to use the function I provided, you open Visual Basic in Excel (Tools menu/Macros), then you add a new module (Insert menu) and you copy-paste the code above. Then, in your workbook, you enter =Bold_sum(C4:C58) to follow your example.