Hey guys,
I've been trying to learn more about array formulas (can't say I'm any good at them). Anyhow, I've been trying to essentially solve the following problem:
Say you have a database such as the following:
Basically, I need to figure out how to write a formula to essentially determine how much money is spent for say the CPU part or the GFX part. So, if I parse the value 'CPU' to the formula, it should return 600 (2x i7 bought). If I parse the value 'GFX', it should return 550 (250 + 300).
I know how to do this in VBA / custom function. But I'm trying to figure out how to do this using only array formulas etc. Any idea how I might go about doing this?
I have to admit, array formulas are my achilles heel. Anyway, any help on this would be greatly appreciated. Thank you!
PS: A little caveat, I do not wish to add any columns/rows etc to provide more info (I know it can be done if you add another column on the 'Items bought' list to lookup the part type). I'm just trying to figure out if this is possible as part of my learning.
EDIT: Fixing table formatting
I've been trying to learn more about array formulas (can't say I'm any good at them). Anyhow, I've been trying to essentially solve the following problem:
Say you have a database such as the following:
Code:
Item Part Price
i7 CPU 300
Phenom CPU 200
5870 GFX 250
GTX295 GFX 300
Items bought
i7
5870
i7
GTX295
Basically, I need to figure out how to write a formula to essentially determine how much money is spent for say the CPU part or the GFX part. So, if I parse the value 'CPU' to the formula, it should return 600 (2x i7 bought). If I parse the value 'GFX', it should return 550 (250 + 300).
I know how to do this in VBA / custom function. But I'm trying to figure out how to do this using only array formulas etc. Any idea how I might go about doing this?
I have to admit, array formulas are my achilles heel. Anyway, any help on this would be greatly appreciated. Thank you!
PS: A little caveat, I do not wish to add any columns/rows etc to provide more info (I know it can be done if you add another column on the 'Items bought' list to lookup the part type). I'm just trying to figure out if this is possible as part of my learning.
EDIT: Fixing table formatting
Last edited: