98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » Colors sumif
Colors sumif
Resolved · Low Priority · Version 2003
Joanna has attended:
Excel Advanced course
Colors sumif
hi, does anyone know how to sum up just cells in a particular colour? thanks
RE: colors sumif
Hi Joanna,
Thank you for your post, welcome to the forum;
I think I have got it, but you will need to use VBA;
Press Alt F11 to get into the VBA editor, then insert a module into your workbook. Into this paste the following:
Function SUMIFCOLOUR(TheRange As Range, TheColourCell As Range) As Variant
Dim TempRange As Range
Dim Result
Dim Colour
Application.Volatile
On Error Goto BailOut
Colour = TheColourCell.Interior.Color
For Each TempRange In TheRange
If Colour = TempRange.Interior.Color Then Result = Result + TempRange.Value
Next
BailOut:
SUMIFCOLOUR = Result
End Function
and hopefully you will get the result you need.
Hope this helps
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Line breaks in a cellYou can control the line breaks for multiple-line headings or labels in your Microsoft Excel worksheet, just like you do in Microsoft Word. Here's how to do it. |