Calculating sums based on lookups in two different tables

FDIOPY

New Member
Joined
Jul 8, 2022
Messages
5
Office Version
  1. 2013
Platform
  1. Windows
Hi all,

I am trying to complete a problem where I have some Items that have both properties and values assigned to them. I would like to sum all values for each property. However, the items are assigned properties and values in different tables, as such:

Items & Properties
ItemProperty
ACircle
BSquare
CTriangle
DSquare
ECircle
FTriangle
GCircle

And:

Items & Values
ItemValue
F
6​
G
7​
E
5​
C
3​
A
1​
D
4​
B
2​

Due to the nature of the data and the format in which it is received, I cannot create any intermediary cells or additional columns, e.g. using a VLOOKUP to assign properties to the second table and a further SUMIF to sum these by property. These two tables need to stay separate and the process needs to be automated as it will be refreshed fairly frequently so requires little to no manual intervention this way.

Sum table for properties
PropertiesSum calc'd
Circle
Square
Triangle

I have been stumped on this for a little while now and have tried a mix of SUMIF, SUMIFS, VLOOKUP, INDEX(MATCH,MATCH) to no success, so if anyone can let me know what formula/mix of formulae I should be using to achieve this that would help me a great deal!!

Thanks.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Welcome to the Forum!

Will this work for you?

ABCDEF
1
2ItemPropertyItemValue
3ACircleF6
4BSquareG7
5CTriangleE5
6DSquareC3
7ECircleA1
8FTriangleD4
9GCircleB2
10
11PropertiesSum calc'd
12Circle13
13Square6
14Triangle9
15
Sheet1
Cell Formulas
RangeFormula
C12:C14C12=SUMPRODUCT(IFERROR(VLOOKUP(IF(C$3:C$9=B12,B$3:B$9),E$3:F$9,2,),0))

Or as tables:

ABCDEF
1tPropertytValue
2ItemPropertyItemValue
3ACircleF6
4BSquareG7
5CTriangleE5
6DSquareC3
7ECircleA1
8FTriangleD4
9GCircleB2
10
11PropertiesSum calc'd
12Circle13
13Square6
14Triangle9
15
Sheet1
Cell Formulas
RangeFormula
C12:C14C12=SUMPRODUCT(IFERROR(VLOOKUP(IF(tProperty[Property]=[@Properties],tProperty[Item]),tValue,2,),0))
 
Upvote 0
Hi Stephen,

That is very helpful, thank you. I have tested this out on Office 365 and it works well, however I should have specified that I am trying to get this function work within the Office 2013 environment, apologies for this. I have tried this out in that environment and it does not seem to return the desired sum values, although I Control+Shift+Enter'd the formula across a couple of cells and it then seemed to work as an array, not sure why and this is not entirely practical although is a step in the right direction. Any advice you might be able to give on adapting this to Office 2013 would be much appreciated!
 
Upvote 0
I should have specified that I am trying to get this function work within the Office 2013 environment ....
No problem. Your account details say 2013, which is what I assumed.

Unfortunately, I don't have access to older versions of Excel to test, but I thought that would work, i.e. that the SUMPRODUCT would be sufficient to make it a non-array formula.

Does this behave any better in 2013?

ABCDEF
1
2ItemPropertyItemValue
3ACircleF6
4BSquareG7
5CTriangleE5
6DSquareC3
7ECircleA1
8FTriangleD4
9GCircleB2
10
11PropertiesSum
12Circle13
13Square6
14Triangle9
Sheet1
Cell Formulas
RangeFormula
C12:C14C12=SUMPRODUCT(VLOOKUP(B$3:B$9,E$3:F$9,2,),--(C$3:C$9=B12))
 
Upvote 0
Unfortunately it returns #VALUE! error now! Making it an array formula still works as before however.
 
Upvote 0
Hi all,

I found a solution: I used an array formula as such:

{=SUMPRODUCT(SUMIFS([VALUE RANGE],[ITEM RANGE2],IF([PROPERTY RANGE]=[LOOKUP PROPERTY],[ITEM RANGE1])))}
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

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