Count IF with data on two sheets

Rosechove

New Member
Joined
Jun 30, 2022
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
Hello,

I am trying to figure out how much in sales each salesperson has generated by location. My issue is the sales information and location information are stored on two separate sheets.

Is there a formula I can use in Table A that will be able to sum the total purchase amounts by area?

Screen Shot 2022-06-30 at 2.20.40 PM.png
(Table A - Summary)

I need to take the total cost from the Purchases sheet. The area is listed per account on the Accounts sheet.

Screen Shot 2022-06-30 at 2.21.02 PM.png
(Table B - Purchases)

Screen Shot 2022-06-30 at 2.21.52 PM.png
(Table C - Accounts)

Thank you in advance!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try the following in the summary tab B2:
VBA Code:
=sumifs(Purchases!D2:D21,Purchases!C2:C21,B$1,Purchases!A2:A21,$A2)
This should work as long as you have all of your locations listed on the summary tab column A

oh, scratch that...I just noticed that purchases column A is not the location.
 
Upvote 0
possibly something like this.
VBA Code:
=sumifs(Purchases!D2:D21,Purchases!C2:C21,B$1,xlookup($A2,Accounts!A2:A6,Accounts!C2:C6),$A2)
 
Upvote 0
Hi & Welcome to MrExcel.
How about
Excel Formula:
=SUM(FILTER(Purchases!$D$2:$D$30,(Purchases!$C$2:$C$30=B$1)*(ISNUMBER(MATCH(Purchases!$A$2:$A$30,FILTER(Accounts!$A$2:$A$30,Accounts!$C$2:$C$30=$A2),0)))))
 
Upvote 0

Forum statistics

Threads
1,214,885
Messages
6,122,090
Members
449,065
Latest member
Danger_SF

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