Sumbycolour and hlookup

d438a1

New Member
Joined
Oct 1, 2017
Messages
3
Hi there,

Is it possible to combine the sumbycolor function and hlookup?

Here is my data file - https://ibb.co/gkdMYw

Summary sheet - https://ibb.co/h3tG0b

I'm trying to dynamically calculate the sum for a given month/project/team. So in cell C4 I'd like to calculate the total for Team B for the green cells by looking up the whole table.

gkdMYw
h3tG0b


Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
What is the condition for the green cells?
 
Upvote 0
1. I am unable to access file-hosting sites, so I cannot see your file.
2. There is no native excel function called sumbucolour, so maybe that is a UDF?
3. Where the colors applied through Conditional Formatting or manually?
4. This code may help...
Code:
Sum by Colors	Function SumColor(rColor As Range, 	
		
	rSumRange As Range)	
	''''''''''''''''''''''''''''''''''''''	
	'Written by Ozgrid Business Applications	
	'www.ozgrid.com	
	'Sums cells based on a specified fill color.	
	'''''''''''''''''''''''''''''''''''''''	
	Dim rCell As Range	
	Dim iCol As Integer	
	Dim vResult	
		
	iCol = rColor.Interior.ColorIndex	
	For Each rCell In rSumRange	
	If rCell.Interior.ColorIndex = iCol Then	
	vResult = WorksheetFunction.Sum(rCell) + vResult	
	End If	
	Next rCell	
	SumColor = vResult	
		
	End Function
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top