How to use Filter Function, Unique Function and Large Function all together?

Lacan

Board Regular
Joined
Oct 5, 2016
Messages
228
Office Version
  1. 365
Platform
  1. Windows
Hello Guys, ??

Have these table below and using Filter Function, Unique Function and Large Function all together.

As you can check by yourself I think Im near finish the formula.

However can´t get the product as Unique one and the match units as the Largest one.

Can you help please? (y)??

Thank you very much

Livro1.xlsx
BCDEFGHIJKLMNOPQRSTUVW
2BrickNameCodeDateMonthProductFacturadasCategoríaUnitsBrutoNeto
3NAME299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608407/01/2020ene. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD113,052,04
4AMATEORA299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608407/02/2020feb. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD126,104,09
501/01/2021299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608410/03/2020mar. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD126,104,09
6299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/01/2020ene. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,5211,89
7NameCodeProductUnits299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/02/2020feb. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425,0423,79
8AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com20299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458919/06/2020jun. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD119,095,95
9AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com6299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458922/07/2020jul. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1218,1811,89
10AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com15299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/09/2020sep. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318,7817,84
11AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com10299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458912/10/2020oct. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425,0423,79
12AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com3299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458911/11/2020nov. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425,0423,79
13AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com14299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458904/02/2021feb. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,528,39
14AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com12299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458904/03/2021mar. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318,7817,84
15AMATEORA3404589ESPIRONOLACTONA ALTER 100 MG - 60 COMP.2299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458929/04/2021abr. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318,7817,84
16AMATEORA3404589ESPIRONOLACTONA ALTER 100 MG - 60 COMP.3299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458906/07/2021jul. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,529,64
17AMATEORA4640884NIFEDIPINA ALTER 20 MG - 60 COMP.1299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/09/2021sep. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,529,64
18AMATEORA4640884NIFEDIPINA ALTER 20 MG - 60 COMP.2299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458906/10/2021oct. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,529,64
19AMATEORA4140182PRAVASTATINA ALTER 20 MG - 60 COMP.1299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/12/2021dic. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,529,64
20AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.50299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/01/2020ene. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100252,00168,84
21AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.40299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238110/03/2020mar. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD155138,6092,86
22AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.60299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/04/2020abr. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1125477,50211,05
23AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.45299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238119/06/2020jun. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD12595,5042,21
24AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.65299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238122/07/2020jul. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150191,0084,42
25299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/09/2020sep. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100252,00168,84
26299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238111/11/2020nov. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100267,00178,89
27299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238108/01/2021ene. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150133,50102,80
28299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/02/2021feb. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD140106,8071,56
29299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/03/2021mar. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150133,50102,80
30299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/04/2021abr. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD160139,20107,18
31299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238129/04/2021abr. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD145104,4080,39
32299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/06/2021jun. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150116,0089,32
33299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/07/2021jul. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150116,0089,32
34299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/08/2021ago. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD14092,8071,46
35299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/09/2021sep. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150116,0089,32
36299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/10/2021oct. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD165150,80116,12
37299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238110/11/2021nov. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD14092,8071,46
38299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/12/2021dic. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150116,0089,32
39299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/01/2020ene. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD140120,4080,67
40299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/04/2020abr. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD130135,0062,71
41299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708319/06/2020jun. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1522,5010,45
42299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708322/07/2020jul. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1836,4016,94
43299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/09/2020sep. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11650,5633,88
44299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708312/10/2020oct. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444,2429,64
45299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708311/11/2020nov. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD12991,6461,40
46299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708308/01/2021ene. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD12063,2048,66
47299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/02/2021feb. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1618,9612,70
48299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/03/2021mar. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11547,4036,50
49299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708329/04/2021abr. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11031,6024,33
50299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/06/2021jun. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD139,487,30
51299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/07/2021jul. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444,2434,06
52299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/08/2021ago. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11031,6024,33
53299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/09/2021sep. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1618,9614,60
54299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/10/2021oct. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11237,9229,20
55299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708310/11/2021nov. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444,2434,06
56299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/12/2021dic. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11237,9229,20
57299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018210/03/2020mar. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,624,44
58299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018206/04/2020abr. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1219,008,87
59299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018207/09/2020sep. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,624,44
60299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018212/10/2020oct. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,624,44
61299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018204/06/2021jun. 2021PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,615,09
62299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018204/08/2021ago. 2021PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,615,09
63299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/01/2020ene. 2020NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
64299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/02/2020feb. 2020NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
65299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088406/04/2021abr. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
66299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088404/06/2021jun. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
67299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088404/08/2021ago. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD128,007,60
68299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/09/2021sep. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD128,007,60
69299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088406/10/2021oct. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
70299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088410/11/2021nov. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD128,007,60
71299 Lx - AMATEORA (MÁgua - Sul)AMATEORA473678107/02/2020feb. 2020PRAVASTATINA ALTER 40 MG - 60 COMP.FacturadasGD119,166,14
72299 Lx - AMATEORA (MÁgua - Sul)AMATEORA473678110/03/2020mar. 2020PRAVASTATINA ALTER 40 MG - 60 COMP.FacturadasGD119,166,14
73299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058107/01/2020ene. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD160107,4071,96
74299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058107/02/2020feb. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD11526,8517,99
75299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058106/04/2020abr. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD170215,6088,17
Folha1
Cell Formulas
RangeFormula
B8:E24B8=UNIQUE(SORT(FILTER(FILTER(N3:U53243,(P3:P53243>=B5)*(N3:N53243=B4)),{1,1,0,0,1,0,0,1}),3,1),,0)
Dynamic array formulas.
 
Brilliant @Eric W !!! ??
Works Perfect!!! ??
Thank you very much my Friend. ????
Dear @Eric W ??

Hope u are fine my friend.
Because my work tablet are very slow and because filter function are a complex formula it takes a little more time then normal to extract results (my table have almost 30.000 rows in 5 different columns).
To check if I can extract data more quickly would like to ask in order to get the same results above do you know a more traditional formula without using filter function?
Thank you very much my friend. ???
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
FILTER is pretty fast. Probably the thing slowing it down is that it has to calculate the SUMIFS for every row. This version only calculates the SUMIFS for the filtered rows:

Excel Formula:
=LET(name,H3:H75,
date,J3:J75,
bruto,P3:P75,
f,UNIQUE(FILTER(CHOOSE({1,2},name,date),(date>=C5)*(date<=C6))),
SORT(CHOOSE({1,2,3},INDEX(f,0,1),INDEX(f,0,2),SUMIFS(bruto,name,INDEX(f,0,1),date,INDEX(f,0,2))),2,1))

If you don't have LET, or if it's still too slow, then you might be looking at a VBA solution. 30,000 rows is a lot for a formula to handle.
 
Upvote 0
FILTER is pretty fast. Probably the thing slowing it down is that it has to calculate the SUMIFS for every row. This version only calculates the SUMIFS for the filtered rows:

Excel Formula:
=LET(name,H3:H75,
date,J3:J75,
bruto,P3:P75,
f,UNIQUE(FILTER(CHOOSE({1,2},name,date),(date>=C5)*(date<=C6))),
SORT(CHOOSE({1,2,3},INDEX(f,0,1),INDEX(f,0,2),SUMIFS(bruto,name,INDEX(f,0,1),date,INDEX(f,0,2))),2,1))

If you don't have LET, or if it's still too slow, then you might be looking at a VBA solution. 30,000 rows is a lot for a formula to handle.
Big @Eric W ??

30,000 rows sure it is.
Sorry Friend the formula requested was to apply in this table below to get the results presented can you please adapt?
Accordingly with your suggestion lets first start with "Let" and after that will give you feedback.
Unfortunately my work tablet is very slow.
Many many thanks bro.???


Livro1.xlsm
ABCDEFGHIJKLMNOPQR
1
2BrickNameCodeDateMonthProductFacturadasCategoríaUnitsBrutoNeto
3NAME299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608407/01/2020ene. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD113,052,04
4AMATEORA299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608407/02/2020feb. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD126,104,09
501/01/2020299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608410/03/2020mar. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD126,104,09
6299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/01/2020ene. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,5211,89
7NameCodeProductUnits299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/02/2020feb. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425,0423,79
8AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com99299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458919/06/2020jun. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD119,095,95
9AMATEORA4780581AMLODIPINA ALTER 5 mg - 60 Com70299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458922/07/2020jul. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1218,1811,89
10AMATEORA3036084DICLOFENAC ALTER 50 MG - 60 COMP.2299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/09/2020sep. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318,7817,84
11AMATEORA3404589ESPIRONOLACTONA ALTER 100 MG - 60 COMP.4299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458912/10/2020oct. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425,0423,79
12AMATEORA4640884NIFEDIPINA ALTER 20 MG - 60 COMP.2299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458911/11/2020nov. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425,0423,79
13AMATEORA4140182PRAVASTATINA ALTER 20 MG - 60 COMP.2299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458904/02/2021feb. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,528,39
14AMATEORA4736781PRAVASTATINA ALTER 40 MG - 60 COMP.1299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458904/03/2021mar. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318,7817,84
15AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.125299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458929/04/2021abr. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318,7817,84
16299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458906/07/2021jul. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,529,64
17299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/09/2021sep. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,529,64
18299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458906/10/2021oct. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,529,64
19299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/12/2021dic. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212,529,64
20299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/01/2020ene. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100252,00168,84
21299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238110/03/2020mar. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD155138,6092,86
22299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/04/2020abr. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1125477,50211,05
23299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238119/06/2020jun. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD12595,5042,21
24299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238122/07/2020jul. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150191,0084,42
25299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/09/2020sep. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100252,00168,84
26299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238111/11/2020nov. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100267,00178,89
27299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238108/01/2021ene. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150133,50102,80
28299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/02/2021feb. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD140106,8071,56
29299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/03/2021mar. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150133,50102,80
30299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/04/2021abr. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD160139,20107,18
31299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238129/04/2021abr. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD145104,4080,39
32299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/06/2021jun. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150116,0089,32
33299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/07/2021jul. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150116,0089,32
34299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/08/2021ago. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD14092,8071,46
35299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/09/2021sep. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150116,0089,32
36299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/10/2021oct. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD165150,80116,12
37299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238110/11/2021nov. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD14092,8071,46
38299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/12/2021dic. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150116,0089,32
39299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/01/2020ene. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD199120,4080,67
40299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/04/2020abr. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD130135,0062,71
41299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708319/06/2020jun. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1522,5010,45
42299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708322/07/2020jul. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1836,4016,94
43299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/09/2020sep. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11650,5633,88
44299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708312/10/2020oct. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444,2429,64
45299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708311/11/2020nov. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD12991,6461,40
46299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708308/01/2021ene. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD12063,2048,66
47299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/02/2021feb. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1618,9612,70
48299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/03/2021mar. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11547,4036,50
49299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708329/04/2021abr. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11031,6024,33
50299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/06/2021jun. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD139,487,30
51299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/07/2021jul. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444,2434,06
52299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/08/2021ago. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11031,6024,33
53299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/09/2021sep. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1618,9614,60
54299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/10/2021oct. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11237,9229,20
55299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708310/11/2021nov. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444,2434,06
56299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/12/2021dic. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11237,9229,20
57299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018210/03/2020mar. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,624,44
58299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018206/04/2020abr. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1219,008,87
59299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018207/09/2020sep. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,624,44
60299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018212/10/2020oct. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,624,44
61299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018204/06/2021jun. 2021PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,615,09
62299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018204/08/2021ago. 2021PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116,615,09
63299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/01/2020ene. 2020NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
64299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/02/2020feb. 2020NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
65299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088406/04/2021abr. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
66299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088404/06/2021jun. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
67299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088404/08/2021ago. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD128,007,60
68299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/09/2021sep. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD128,007,60
69299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088406/10/2021oct. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD114,003,80
70299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088410/11/2021nov. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD128,007,60
71299 Lx - AMATEORA (MÁgua - Sul)AMATEORA473678107/02/2020feb. 2020PRAVASTATINA ALTER 40 MG - 60 COMP.FacturadasGD119,166,14
72299 Lx - AMATEORA (MÁgua - Sul)AMATEORA473678110/03/2020mar. 2020PRAVASTATINA ALTER 40 MG - 60 COMP.FacturadasGD119,166,14
73299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058107/01/2020ene. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD160107,4071,96
74299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058107/02/2020feb. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD11526,8517,99
75299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058106/04/2020abr. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD170215,6088,17
76
77
Folha1
Cell Formulas
RangeFormula
B8:E15B8=UNIQUE(SORT(FILTER(CHOOSE({1,2,3,4},H3:H99,I3:I99,L3:L99,MAXIFS(O3:O99,H3:H99,H3:H99,I3:I99,I3:I99,L3:L99,L3:L99)),(J3:J99>=B5)*(H3:H99=B4)),3))
Dynamic array formulas.
 
Upvote 0
To rewrite that formula in the same manner would be:

Book1 (version 1).xlsb
ABCDE
1
2
3NAME
4AMATEORA
51/1/2020
6
7NameCodeProductUnits
8AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com99
9AMATEORA4780581AMLODIPINA ALTER 5 mg - 60 Com70
10AMATEORA3036084DICLOFENAC ALTER 50 MG - 60 COMP.2
11AMATEORA3404589ESPIRONOLACTONA ALTER 100 MG - 60 COMP.4
12AMATEORA4640884NIFEDIPINA ALTER 20 MG - 60 COMP.2
13AMATEORA4140182PRAVASTATINA ALTER 20 MG - 60 COMP.2
14AMATEORA4736781PRAVASTATINA ALTER 40 MG - 60 COMP.1
15AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.125
16
Sheet23
Cell Formulas
RangeFormula
B8:E15B8=LET( name,H3:H99, code,I3:I99, product,L3:L99, date,J3:J99, units,O3:O99, f,UNIQUE(FILTER(CHOOSE({1,2,3},name,code,product),(date>=B5)*(name=B4))), SORT(CHOOSE({1,2,3,4},INDEX(f,0,1),INDEX(f,0,2),INDEX(f,0,3),MAXIFS(units,name,INDEX(f,0,1),code,INDEX(f,0,2),product,INDEX(f,0,3),date,">="&B5)),3))
Dynamic array formulas.


But again, I still can't say how much improvement you may get.
 
Upvote 0
Solution
To rewrite that formula in the same manner would be:

Book1 (version 1).xlsb
ABCDE
1
2
3NAME
4AMATEORA
51/1/2020
6
7NameCodeProductUnits
8AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com99
9AMATEORA4780581AMLODIPINA ALTER 5 mg - 60 Com70
10AMATEORA3036084DICLOFENAC ALTER 50 MG - 60 COMP.2
11AMATEORA3404589ESPIRONOLACTONA ALTER 100 MG - 60 COMP.4
12AMATEORA4640884NIFEDIPINA ALTER 20 MG - 60 COMP.2
13AMATEORA4140182PRAVASTATINA ALTER 20 MG - 60 COMP.2
14AMATEORA4736781PRAVASTATINA ALTER 40 MG - 60 COMP.1
15AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.125
16
Sheet23
Cell Formulas
RangeFormula
B8:E15B8=LET( name,H3:H99, code,I3:I99, product,L3:L99, date,J3:J99, units,O3:O99, f,UNIQUE(FILTER(CHOOSE({1,2,3},name,code,product),(date>=B5)*(name=B4))), SORT(CHOOSE({1,2,3,4},INDEX(f,0,1),INDEX(f,0,2),INDEX(f,0,3),MAXIFS(units,name,INDEX(f,0,1),code,INDEX(f,0,2),product,INDEX(f,0,3),date,">="&B5)),3))
Dynamic array formulas.


But again, I still can't say how much improvement you may get.
Dear @Eric W
Both solutions works amazing works perfect!!! ?????
Thank you very much!!!!!!!?????
Big hug.
 
Upvote 0
Dear @Eric W 😉

Since last time 2022 hope u are great! 💪👍
Just need an upgrade of your magnificent formula.
Through your unique formula would like to add one more column "Early Date" results.
To give you an example of the goal just made it in a separate column F8:F15 with the results expected.
How can you incorporate the same results in your initially formula?
Feel free to develop as you think is best.
Thank you very much my friend.💪💪🙏🍻🍻

Livro1.xlsm
ABCDEFGHIJKLMNOPQRS
1
2BrickNameCodeDateMonthProductFacturadasCategoríaUnitsBrutoNeto
3NAME299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608407/01/2020ene. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD113.052.04
4AMATEORA299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608407/02/2020feb. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD156.14.09
5299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608410/03/2024mar. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD126.14.09
6299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/01/2020ene. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.5211.89
7NameCodeProductUnitsEarly Date299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/02/2020feb. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425.0423.79
8AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com9922/07/2023299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458919/06/2020jun. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD119.095.95
9AMATEORA4780581AMLODIPINA ALTER 5 mg - 60 Com7007/02/2022299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458922/07/2020jul. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1218.1811.89
10AMATEORA3036084DICLOFENAC ALTER 50 MG - 60 COMP.510/03/2024299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/09/2020sep. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318.7817.84
11AMATEORA3404589ESPIRONOLACTONA ALTER 100 MG - 60 COMP.407/12/2021299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458912/10/2020oct. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425.0423.79
12AMATEORA4640884NIFEDIPINA ALTER 20 MG - 60 COMP.210/11/2021299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458911/11/2020nov. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425.0423.79
13AMATEORA4140182PRAVASTATINA ALTER 20 MG - 60 COMP.204/08/2021299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458904/02/2021feb. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.528.39
14AMATEORA4736781PRAVASTATINA ALTER 40 MG - 60 COMP.110/03/2020299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458904/03/2021mar. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318.7817.84
15AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.12522/07/2024299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458929/04/2021abr. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318.7817.84
16299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458906/07/2021jul. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.529.64
17299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/09/2021sep. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.529.64
18299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458906/10/2021oct. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.529.64
19299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/12/2021dic. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.529.64
20299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/01/2020ene. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100252168.84
21299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238110/03/2020mar. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD155138.692.86
22299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/04/2020abr. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1125477.5211.05
23299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238119/06/2020jun. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD12595.542.21
24299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238122/07/2024jul. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15019184.42
25299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/09/2020sep. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100252168.84
26299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238111/11/2020nov. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100267178.89
27299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238108/01/2021ene. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150133.5102.8
28299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/02/2021feb. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD140106.871.56
29299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/03/2021mar. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150133.5102.8
30299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/04/2021abr. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD160139.2107.18
31299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238129/04/2021abr. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD145104.480.39
32299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/06/2021jun. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15011689.32
33299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/07/2021jul. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15011689.32
34299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/08/2021ago. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD14092.871.46
35299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/09/2021sep. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15011689.32
36299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/10/2021oct. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD165150.8116.12
37299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238110/11/2021nov. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD14092.871.46
38299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/12/2021dic. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15011689.32
39299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/01/2020ene. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD199120.480.67
40299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/04/2020abr. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD13013562.71
41299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708319/06/2020jun. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1522.510.45
42299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708322/07/2023jul. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1836.416.94
43299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/09/2020sep. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11650.5633.88
44299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708312/10/2020oct. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444.2429.64
45299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708311/11/2020nov. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD12991.6461.4
46299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708308/01/2021ene. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD12063.248.66
47299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/02/2021feb. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1618.9612.7
48299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/03/2021mar. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11547.436.5
49299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708329/04/2021abr. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11031.624.33
50299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/06/2021jun. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD139.487.3
51299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/07/2021jul. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444.2434.06
52299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/08/2021ago. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11031.624.33
53299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/09/2021sep. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1618.9614.6
54299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/10/2021oct. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11237.9229.2
55299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708310/11/2021nov. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444.2434.06
56299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/12/2021dic. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11237.9229.2
57299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018210/03/2020mar. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.624.44
58299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018206/04/2020abr. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD12198.87
59299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018207/09/2020sep. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.624.44
60299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018212/10/2020oct. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.624.44
61299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018204/06/2021jun. 2021PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.615.09
62299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018204/08/2021ago. 2021PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.615.09
63299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/01/2020ene. 2020NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
64299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/02/2020feb. 2020NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
65299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088406/04/2021abr. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
66299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088404/06/2021jun. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
67299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088404/08/2021ago. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1287.6
68299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/09/2021sep. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1287.6
69299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088406/10/2021oct. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
70299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088410/11/2021nov. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1287.6
71299 Lx - AMATEORA (MÁgua - Sul)AMATEORA473678107/02/2020feb. 2020PRAVASTATINA ALTER 40 MG - 60 COMP.FacturadasGD119.166.14
72299 Lx - AMATEORA (MÁgua - Sul)AMATEORA473678110/03/2020mar. 2020PRAVASTATINA ALTER 40 MG - 60 COMP.FacturadasGD119.166.14
73299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058107/01/2020ene. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD160107.471.96
74299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058107/02/2022feb. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD11526.8517.99
75299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058106/04/2020abr. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD170215.688.17
76
77
78
Folha5
 
Upvote 0
See if this works for you:
B8:
Excel Formula:
=LET(
name,I3:I99,
code,J3:J99,
product,M3:M99,
date,K3:K99,
units,P3:P99,
f,UNIQUE(FILTER(CHOOSE({1,2,3},name,code,product),(name=B4))),
un,INDEX(f,0,1),
uc,INDEX(f,0,2),
up,INDEX(f,0,3),
maxunit,MAXIFS(units,name,un,code,uc,product,up),
maxdate,MAXIFS(date,name,un,code,uc,product,up),
SORT(CHOOSE({1,2,3,4,5},un,uc,up,maxunit,maxdate),3))
 
Upvote 0
Dear @Eric W

In one word - PERFECT!!!!!🔝🔝👍👍
Works amazing - like a glove!

Probably will have to reach you soon to make an upgrade.
Thank you very much!!!
Take care. 💪💪🍻🍻
Big hug.👍👍
 
Upvote 0
Dear @Eric W

As said will need an upgrade in your formula.
Through your unique formula would like to add a new column with the results "Units that match First Date" .
Just put an example of the results expected in column G8:G15. Think is very intuite want I´m looking for.
Through your unique last formula how to upgrade it to achieve also this new results?
Thank you very much!!! 👍👍👊👊🍻🍻

Livro1.xlsm
ABCDEFGHIJKLMNOPQRST
1
2BrickNameCodeDateMonthProductFacturadasCategoríaUnitsBrutoNeto
3NAME299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608407/01/2020ene. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD113.052.04
4AMATEORA299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608407/02/2020feb. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD156.14.09
5299 Lx - AMATEORA (MÁgua - Sul)AMATEORA303608410/03/2024mar. 2020DICLOFENAC ALTER 50 MG - 60 COMP.FacturadasGD126.14.09
6299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/01/2020ene. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.5211.89
7NameCodeProductUnitsFirst DateUnits that match First Date299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/02/2020feb. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425.0423.79
8AMATEORA4017083AMLODIPINA ALTER 10 mg - 60 Com9906/04/202430299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458919/06/2020jun. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD119.095.95
9AMATEORA4780581AMLODIPINA ALTER 5 mg - 60 Com7007/02/202215299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458922/07/2020jul. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1218.1811.89
10AMATEORA3036084DICLOFENAC ALTER 50 MG - 60 COMP.510/03/20242299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/09/2020sep. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318.7817.84
11AMATEORA3404589ESPIRONOLACTONA ALTER 100 MG - 60 COMP.2004/09/20253299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458912/10/2020oct. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425.0423.79
12AMATEORA4640884NIFEDIPINA ALTER 20 MG - 60 COMP.210/11/20212299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458911/11/2020nov. 2020ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1425.0423.79
13AMATEORA4140182PRAVASTATINA ALTER 20 MG - 60 COMP.604/08/20216299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458904/02/2021feb. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.528.39
14AMATEORA4736781PRAVASTATINA ALTER 40 MG - 60 COMP.710/03/20207299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458904/09/2025mar. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1318.7817.84
15AMATEORA4012381SINVASTATINA ALTER 20 MG - 60 COMP.14311/11/2026100299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458929/04/2021abr. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD12018.7817.84
16299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458906/07/2021jul. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.529.64
17299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/09/2021sep. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.529.64
18299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458906/10/2021oct. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.529.64
19299 Lx - AMATEORA (MÁgua - Sul)AMATEORA340458907/12/2021dic. 2021ESPIRONOLACTONA ALTER 100 MG - 60 COMP.FacturadasGD1212.529.64
20299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/01/2020ene. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100252168.84
21299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238110/03/2020mar. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD155138.692.86
22299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/04/2020abr. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1143477.5211.05
23299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238119/06/2020jun. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD12595.542.21
24299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238122/07/2024jul. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15019184.42
25299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/09/2020sep. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100252168.84
26299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238111/11/2026nov. 2020SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD1100267178.89
27299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238108/01/2021ene. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150133.5102.8
28299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/02/2021feb. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD140106.871.56
29299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/03/2021mar. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD150133.5102.8
30299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/04/2021abr. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD160139.2107.18
31299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238129/04/2021abr. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD145104.480.39
32299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/06/2021jun. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15011689.32
33299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/07/2021jul. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15011689.32
34299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238104/08/2021ago. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD14092.871.46
35299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/09/2021sep. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15011689.32
36299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238106/10/2021oct. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD165150.8116.12
37299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238110/11/2021nov. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD14092.871.46
38299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401238107/12/2021dic. 2021SINVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD15011689.32
39299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/01/2020ene. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD199120.480.67
40299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/04/2024abr. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD13013562.71
41299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708319/06/2020jun. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1522.510.45
42299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708322/07/2023jul. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1836.416.94
43299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/09/2020sep. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11650.5633.88
44299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708312/10/2020oct. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444.2429.64
45299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708311/11/2020nov. 2020AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD12991.6461.4
46299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708308/01/2021ene. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD12063.248.66
47299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/02/2021feb. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1618.9612.7
48299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/03/2021mar. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11547.436.5
49299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708329/04/2021abr. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11031.624.33
50299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/06/2021jun. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD139.487.3
51299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/07/2021jul. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444.2434.06
52299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708304/08/2021ago. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11031.624.33
53299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/09/2021sep. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD1618.9614.6
54299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708306/10/2021oct. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11237.9229.2
55299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708310/11/2021nov. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11444.2434.06
56299 Lx - AMATEORA (MÁgua - Sul)AMATEORA401708307/12/2021dic. 2021AMLODIPINA ALTER 10 mg - 60 ComFacturadasGD11237.9229.2
57299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018210/03/2020mar. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.624.44
58299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018206/04/2020abr. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD12198.87
59299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018207/09/2020sep. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.624.44
60299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018212/10/2020oct. 2020PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.624.44
61299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018204/06/2021jun. 2021PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD116.615.09
62299 Lx - AMATEORA (MÁgua - Sul)AMATEORA414018204/08/2021ago. 2021PRAVASTATINA ALTER 20 MG - 60 COMP.FacturadasGD166.615.09
63299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/01/2020ene. 2020NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
64299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/02/2020feb. 2020NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
65299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088406/04/2021abr. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
66299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088404/06/2021jun. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
67299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088404/08/2021ago. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1287.6
68299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088407/09/2021sep. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1287.6
69299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088406/10/2021oct. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1143.8
70299 Lx - AMATEORA (MÁgua - Sul)AMATEORA464088410/11/2021nov. 2021NIFEDIPINA ALTER 20 MG - 60 COMP.FacturadasGD1287.6
71299 Lx - AMATEORA (MÁgua - Sul)AMATEORA473678107/02/2020feb. 2020PRAVASTATINA ALTER 40 MG - 60 COMP.FacturadasGD119.166.14
72299 Lx - AMATEORA (MÁgua - Sul)AMATEORA473678110/03/2020mar. 2020PRAVASTATINA ALTER 40 MG - 60 COMP.FacturadasGD179.166.14
73299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058107/01/2020ene. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD160107.471.96
74299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058107/02/2022feb. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD11526.8517.99
75299 Lx - AMATEORA (MÁgua - Sul)AMATEORA478058106/04/2020abr. 2020AMLODIPINA ALTER 5 mg - 60 ComFacturadasGD170215.688.17
76
Folha5 (2)
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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