Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

colors sumif

ResolvedVersion 2003

Joanna has attended:
Excel Advanced course

Colors sumif

hi, does anyone know how to sum up just cells in a particular colour? thanks

Edited on Fri 18 Jul 2008, 16:43

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

Excel tip:

How to select certain data in an Excel 2010 workbook

If you want to select the correct data set in a page full of data, the most accurate and efficient way of doing this is to use the ''Shift and Click'' technique.

For example: If you want to select all data in cells A2 to E10, then click on cell A2, hold down the Shift key and click on cell E10 and all the data you want to see is highlighted.

Keep holding down the Shift key and you can move from cell E10 to any other cell in the spreadsheet.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.