Using Filter Function how to extract and sum data when different columns have the same name?

Lacan

Board Regular
Joined
Oct 5, 2016
Messages
163
Office Version
  1. 365
Platform
  1. Windows
Dear Guys,

It seams so simple that it bothers me.

Accordingly table below using Filter Function how to extract and sum data when different columns have the same name?

Choosing name from data validation in cell B3 how to filtered it with unique name, unique code and unique product and sum the total amount of units across all months?

Hope that you could help.?

Eternally grateful.?

Thank you very much.

Novo Folha de Cálculo do Microsoft Excel.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXY
1
2NAME
3A
4
5
6NAMECODEPRODUCTTOTAL SUM UNITS ene.21 until abr.2021ene. 2021ene. 2021ene. 2021feb. 2021feb. 2021feb. 2021mar. 21mar. 21mar. 21abr. 2021abr. 2021abr. 2021
7NAMEBRICKCODEPRODUCTFACTUREDunitsgrossnetunitsgrossnetunitsgrossnetunitsgrossnet
8AA315 LX100ESPIRO----10504052314---
9BA315 LX200DICLO-2103--84105942
10CA315 LX300GABA-152------521
11C316 LX100ESPIRO-521--63--211
12B320 LX50AMLO----105----732
13A315 LX40AMOX-2105------632
14B320 LX10AVA------5211---
15C316 LX200DICO-25221----211
16C316 LX300GABA------2111111
17B320 LX50AMLO-252111111421
18
19
20
Folha10
Cell Formulas
RangeFormula
G8:G10G8=SORT(UNIQUE(H8:H17))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
B3List=$G$8:$G$10
 
Works Like Magic.
Be very careful using concatenated criteria, it works with your small example but can often give erroneous results. The correct method is either to check each criteria individually as I have done, or to use a delimiter between each of the criteria and criteria ranges that can not be found in the data. I should also point out that despite making the formula shorter, the concatenating method is less efficient.

I had made a couple of alterations to the sheet on the assumption that the date range to sum could be variable, something that @JEC has not allowed for. If this is not necessary and it will always be the sum of all units in the sheet then my formula can be shortened to
Excel Formula:
=SUMPRODUCT(($H$8:$H$17=B7)*($J$8:$J$17=C7)*($K$8:$K$17=D7)*($M$7:$X$7="units"),$M$8:$X$17)
and used with the original sheet layout.
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Be very careful using concatenated criteria, it works with your small example but can often give erroneous results. The correct method is either to check each criteria individually as I have done, or to use a delimiter between each of the criteria and criteria ranges that can not be found in the data. I should also point out that despite making the formula shorter, the concatenating method is less efficient.

I had made a couple of alterations to the sheet on the assumption that the date range to sum could be variable, something that @JEC has not allowed for. If this is not necessary and it will always be the sum of all units in the sheet then my formula can be shortened to
Excel Formula:
=SUMPRODUCT(($H$8:$H$17=B7)*($J$8:$J$17=C7)*($K$8:$K$17=D7)*($M$7:$X$7="units"),$M$8:$X$17)
and used with the original sheet layout.
@jasonb75

Sorry.
Thank you very much ?????
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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