How to use SUMIF & VLOOKUP on filtered results

megamanx85x

New Member
Joined
Dec 24, 2019
Messages
5
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi there, I started a new job in which I have been tasked to filter out an excel sheet that logs all the jobs that were inspected everyday. It has multiple columns in which the critical data is filtering out the defect code and the quantity associated with it.

Originally I managed to make a formula in this mannner: =SUMIF('NAME OF SHEET'!K:K, VLOOKUP(A28,'NAME OF SHEET'!K:L,1,FALSE),'NAME OF SHEET'!L:L)

This worked fine as the entire two columns K and L would total up all the defect codes in relations to "A#" and etc. However this was a setback on my part as I need the sheet that sums up all the defect codes to be categorized by item #, there are more then thirty item #'s I can filter in the column and when I attempt to use the same formula it still grabs all the data in the two columns.

So now I tried to make a new formula that would only focus on the filtered data after the item # has been selected, and it hasn't worked obviously since I'm here; it looks like this:

=VLOOKUP(U2,IF(SUBTOTAL(3,OFFSET(K2:K100,ROW(K2:K100)-ROW(K2),0,1))>0,K2:L100)2,0)

I'm sure many of you will see what didn't go wrong but I am aware of the SUBTOTAL command 3 is not for SUM, this is the only option that works the way I have it set up and its only COUNTA which isn't what I need. If I attempt to use either 9 or 109 the formula errors out.

Its critical that I have this formula be on the second sheet and reference the original sheet location for columns/row K & L, please if anyone can help in correcting me on how to make sure it grabs only filtered data and SUMS it all up I would greatly appreciate it.

Also Merry Christmas!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,214,620
Messages
6,120,559
Members
448,970
Latest member
kennimack

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