Lookup based on 3 criteria, summing and requiring index function

Gillman

New Member
Joined
Feb 15, 2010
Messages
5
Hi there,

I have hit a slight snag...

On the datasheet I need to retrieve numbers from, I have months running down Column A and payroll numbers running down Column B and account codes running across row 2. The problem is I need it to sum based on column A, month and column B, payroll number (a payroll number may appear twice in any given month), and the account codes in row 2 only ever appear once.

On my main sheet, I require a lookup which uses the indirect function to reference the datasheet and retrieve based on these three variable criterion defined on my main sheet (for example month will change).

Month (datasheet column A) - I need to sum based on this,
Payroll number (datasheet column B) - I need to sum based on this and
Account code (datasheet row 2).

Is there a formula I could setup to do this for me? If any of this is not clear enough, please let me know.

I’d appreciate any help anyone is able to offer on this.

Cheers,
Darren
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Darren can you look to show some sample data, I think you need a SumIF formula but jsut need to check it with some sample data.
 
Upvote 0
Solved: Lookup based on 3 criteria, summing and requiring index function

Thanks for your response, I appreciate it. I actually managed to find a formula which will do this for me:

=SUMPRODUCT((INDIRECT($A$3&"!$A$3:$A$11")=$D$4)*(INDIRECT($A$3&"!$B$3:$B$11")=A6)*(INDIRECT($A$3&"!$E$2:$H$2")=B6)*(INDIRECT($A$3&"!$E$3:$H$11")))

Thanks again.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,358
Messages
6,124,487
Members
449,165
Latest member
ChipDude83

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