How to filtered/extract names and calculate difference between values?

Lacan

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

Hope everyone is ok!👌👍
Would like some help in order to filtered/extract names and calculate difference between atual month (December) and average?
Some notes:
-Only names if value average is greater then value atual month;
-Not blank cells.
In sheet there is the example of Expected Results.
Any question, please let me know.
Thank you very much.
Big hug.💪💪🍻

Fórmula Principal para o Ficheiro VDF.xlsm
ABCDEFGHIJKLMNOPQ
1
2NAMESJAN. 2024FEV. 2024MAR. 2024ABR. 2024MAI. 2024JUN. 2024JUL. 2024AGO. 2024SET. 2024OUT. 2024NOV. 2024DEZ. 2024TOTALAVERAGE
3JOHN  
4ANNA3010055101016027
5LISA10435033787510010
6MARIE505010020067
7ROB1234100888413815
8
9EXPECTED RESULTS
10ANNA17
11LISA5
12ROB11
13
14
07-12-2024
Cell Formulas
RangeFormula
O3:O7O3=SUM(Tabela7[@[JAN. 2024]:[DEZ. 2024]])
P3:P7P3=IFERROR(AVERAGE(Tabela7[@[JAN. 2024]:[DEZ. 2024]]),"")
 
@Lacan Here we go:

MrExcel_2024-12.xlsm
BCDEFGHIJKLMNOPQ
2NAMESENE. LU.FEB. JU.MAR. VI.ABR. LU.MAY. MI.JUN. SÁ.JUL. LU.AGO. JU.SEP. DO.OCT. MA.NOV. VI.DIC. DO.TOTALAVERAGEEXCLUDE
3JOHN0 
4ANNA3010055101016027
5LISA10435033787510010
6MARIE505010050x
7ROB12341008881014416
8
9RESULTSTOTAL
10ANNA1728
11LISA5
12ROB6
07-12-2024 (2)
Cell Formulas
RangeFormula
C2:N2C2=TRANSPOSE(UPPER(TEXT(EDATE(EOMONTH(TODAY(),-12)+1,SEQUENCE(12,1,0)),"[$-es-ES]mmm aaa")))
O3:O7O3=SUM('07-12-2024 (2)'!$C3:$N3)
P3:P7P3=IFERROR(AVERAGE('07-12-2024 (2)'!$C3:$N3),"")
B10:C12B10=LET(Name,B3:B7,Tot,O3:O7,Avrg,P3:P7,curMonVal,XLOOKUP(UPPER(TEXT(TODAY(),"[$-es-ES]mmm aaa")),C2#,C3:N7,"N/A",0,1),deltaAV,IFERROR(ROUND(Avrg-curMonVal,0),0),crit,deltaAV>0,ex,Q3:Q7="",Result,FILTER(HSTACK(Name,deltaAV),(crit*ex)),Result)
D10D10=SUM(C10:C13)
Dynamic array formulas.


Just type anything into the EXCLUDE column and the corresponding row (Name) will be excluded.
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
@Lacan Here we go:

MrExcel_2024-12.xlsm
BCDEFGHIJKLMNOPQ
2NAMESENE. LU.FEB. JU.MAR. VI.ABR. LU.MAY. MI.JUN. SÁ.JUL. LU.AGO. JU.SEP. DO.OCT. MA.NOV. VI.DIC. DO.TOTALAVERAGEEXCLUDE
3JOHN0 
4ANNA3010055101016027
5LISA10435033787510010
6MARIE505010050x
7ROB12341008881014416
8
9RESULTSTOTAL
10ANNA1728
11LISA5
12ROB6
07-12-2024 (2)
Cell Formulas
RangeFormula
C2:N2C2=TRANSPOSE(UPPER(TEXT(EDATE(EOMONTH(TODAY(),-12)+1,SEQUENCE(12,1,0)),"[$-es-ES]mmm aaa")))
O3:O7O3=SUM('07-12-2024 (2)'!$C3:$N3)
P3:P7P3=IFERROR(AVERAGE('07-12-2024 (2)'!$C3:$N3),"")
B10:C12B10=LET(Name,B3:B7,Tot,O3:O7,Avrg,P3:P7,curMonVal,XLOOKUP(UPPER(TEXT(TODAY(),"[$-es-ES]mmm aaa")),C2#,C3:N7,"N/A",0,1),deltaAV,IFERROR(ROUND(Avrg-curMonVal,0),0),crit,deltaAV>0,ex,Q3:Q7="",Result,FILTER(HSTACK(Name,deltaAV),(crit*ex)),Result)
D10D10=SUM(C10:C13)
Dynamic array formulas.


Just type anything into the EXCLUDE column and the corresponding row (Name) will be excluded.

Dear @PeteWright

Thanks again.
Fortunately figured out also how to add "exclude list" in your formula near to my job workbook.
To finish would like to add in your formula the sum function and to be integrated in an unique formula like in table "Expected Results".

To conclude please can you give a hand?
Thank you very much.💪💪🙏🍺🍺

Fórmula Principal para o Ficheiro VDF.xlsm
ABCDEFGHIJKLMNOPQ
1
2NAMESENE. 2024FEB. 2024MAR. 2024ABR. 2024MAY. 2024JUN. 2024JUL. 2024AGO. 2024SEP. 2024OCT. 2024NOV. 2024DIC. 2024TOTALAVERAGE
3JOHN  
4ANNA3010055101016027
5LISA10435033787510010
6MARIE505010050
7ROB12341008881014416
8
9EXPECTED RESULTSTOTALEXCLUDE LIST
10LISA555ANNA
11MARIE50ROB
12
13
07-12-2024 (2)
Cell Formulas
RangeFormula
C2:N2C2=TRANSPOSE(UPPER(TEXT(EDATE(EOMONTH(TODAY(),-12)+1,SEQUENCE(12,1,0)),"[$-es-ES]mmm aaa")))
O3:O7O3=SUM('07-12-2024 (2)'!$C3:$N3)
P3:P7P3=IFERROR(AVERAGE('07-12-2024 (2)'!$C3:$N3),"")
B10:C11B10=LET(Name,B3:B7,Tot,O3:O7,Avrg,P3:P7,curMonVal,XLOOKUP(UPPER(TEXT(TODAY(),"[$-es-ES]mmm aaa")),C2#,C3:N7,"N/A",0,1),deltaAV,IFERROR(ROUND(Avrg-curMonVal,0),0),crit,deltaAV>0,Result,FILTER(HSTACK(Name,deltaAV),crit*ISNA(MATCH(Name,F10:F12,0))),Result)
D10D10=SUM(C10:C13)
Dynamic array formulas.
 
Upvote 0
@Lacan How would you like it to be?
Fortunately figured out also how to add "exclude list" in your formula near to my job workbook.
To finish would like to add in your formula the sum function and to be integrated in an unique formula like in table "Expected Results".
Should the "exclude list" be some fixed range in your worksheet? If so, it would be "hard coded" and limited to a static number of exclusions.
That's why I came up with the idea of adding an extra column to the right of your table.
So you don't like it :cry:

Please let me know how you would like to handle excluded names and I'll incorporate that in a formula.

EDIT:
If you use an exclude list where you just "type in" the names there could also be a typo which would result in that name not being excluded.
Think about that too ;)
 
Upvote 0
P.S. How about checkboxes?

1733782318662.png


Edit 2:
Are there always 5 entries / names or can there be more?
 
Last edited:
Upvote 0
P.S. How about checkboxes?

View attachment 120201

Edit 2:
Are there always 5 entries / names or can there be more?

Dear @PeteWright

First, thank you very much!!! 🔝🔝
You´re the Greatest!!!! 💪💪👍👍
In my main List have almost 250 entries/names and in the exclude List contains 6 entries/names.
What you think to be pratical and efficient?

If you could would like to add the sum in your Let formula in order to sum all the entries/names if meet criteria.
1733869360641.png


We keep in touch my friend.
Very grateful!!!👍👍🍻
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,754
Members
452,940
Latest member
rootytrip

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