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]]),"")
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Try this:

MrExcel_2024-12.xlsm
BCDEFGHIJKLMNOPQ
1NAMESJAN. 2024FEV. 2024MAR. 2024ABR. 2024MAI. 2024JUN. 2024JUL. 2024AGO. 2024SET. 2024OUT. 2024NOV. 2024DEZ. 2024TOTALAVARAGERESULT
2123456789101112
3JOHN0  
4ANNA301005510101602717
5LISA104350337875100105
6MARIE505010020067 
7ROB123410088841381511
8
9RESULTS
10ANNA17
11LISA5
12ROB11
Sheet1
Cell Formulas
RangeFormula
O3:O7O3=SUM(Tabela7[@[JAN. 2024]:[DEZ. 2024]])
P3:P7P3=IFERROR(AVERAGE(Tabela7[@[JAN. 2024]:[DEZ. 2024]]),"")
Q3:Q7Q3= IF(AND(P3>INDEX(C3:N3,1,XMATCH(MONTH(TODAY()),MONTH($C$2:$N$2),0,1)),P3<>""), ABS(INDEX(C3:N3,1,XMATCH(MONTH(TODAY()),MONTH($C$2:$N$2),0,1))-P3), "")
B10:C12B10= FILTER(FILTER(B3:Q7,Q3:Q7<>""),{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1})
Dynamic array formulas.


Edit:
Keep in mind that cells C2:N2 have to be actual dates in order to make the formulas work!
For this I use values from 1/24 to 12/24 with custom number formatting m (but you could use any format here like mmm. yyyy)
 
Last edited:
Upvote 0
Dear @PeteWright

Thank you very much for your help.
In order to help just made a formula to make months sequentially.
Think a formula with Let function and Filter function would be shorter, simple and efficiency.
Can you please help?
Again, thank you very much!!!💪💪👍

Fórmula Principal para o Ficheiro VDF.xlsm
ABCDEFGHIJKLMNOPQ
1
2NAMESJAN. 24FEV. 24MAR. 24ABR. 24MAI. 24JUN. 24JUL. 24AGO. 24SET. 24OUT. 24NOV. 24DEZ. 24TOTALAVERAGE
3JOHN  
4ANNA3010055101016027
5LISA10435033787510010
6MARIE505010020067
7ROB1234100888413815
8
9EXPECTED RESULTS
10ANNA17
11LISA5
12ROB11
13
14
07-12-2024
Cell Formulas
RangeFormula
C2:N2C2=TRANSPOSE(UPPER(TEXT(EDATE(EOMONTH(TODAY(),-12)+1,SEQUENCE(12,1,0)),"mmm. aa")))
O3:O7O3=SUM('07-12-2024'!$C3:$N3)
P3:P7P3=IFERROR(AVERAGE('07-12-2024'!$C3:$N3),"")
Dynamic array formulas.
 
Upvote 0
This should do it:

MrExcel_2024-12.xlsm
BCDEFGHIJKLMNOP
2NAMESJAN. 24FEB. 24MAR. 24APR. 24MAY. 24JUN. 24JUL. 24AUG. 24SEP. 24OCT. 24NOV. 24DEC. 24TOTALAVERAGE
3JOHN0 
4ANNA3010055101016027
5LISA10435033787510010
6MARIE505010020067
7ROB1234100888413815
8
9EXPECTED RESULTS
10ANNA17
11LISA5
12ROB11
07-12-2024
Cell Formulas
RangeFormula
C2:N2C2=TRANSPOSE(UPPER(TEXT(EDATE(EOMONTH(TODAY(),-12)+1,SEQUENCE(12,1,0)),"mmm. yy")))
O3:O7O3=SUM('07-12-2024'!$C3:$N3)
P3:P7P3=IFERROR(AVERAGE('07-12-2024'!$C3:$N3),"")
B10:C12B10=LET(Name,B3:B7,Tot,O3:O7,Avrg,P3:P7,curMonVal,XLOOKUP(UPPER(TEXT(TODAY(),"mmm. yy")),C2#,C3:N7,"N/A",0,1),deltaAV,IFERROR(ROUND(Avrg-curMonVal,0),0),crit,deltaAV>0,Result,FILTER(HSTACK(Name,deltaAV),crit),Result)
Dynamic array formulas.



Edit:
Please change the formulas to match your locale, e.g. "mmm. aa" instead of "mmm. yy"
 
Upvote 0
This should do it:

MrExcel_2024-12.xlsm
BCDEFGHIJKLMNOP
2NAMESJAN. 24FEB. 24MAR. 24APR. 24MAY. 24JUN. 24JUL. 24AUG. 24SEP. 24OCT. 24NOV. 24DEC. 24TOTALAVERAGE
3JOHN0 
4ANNA3010055101016027
5LISA10435033787510010
6MARIE505010020067
7ROB1234100888413815
8
9EXPECTED RESULTS
10ANNA17
11LISA5
12ROB11
07-12-2024
Cell Formulas
RangeFormula
C2:N2C2=TRANSPOSE(UPPER(TEXT(EDATE(EOMONTH(TODAY(),-12)+1,SEQUENCE(12,1,0)),"mmm. yy")))
O3:O7O3=SUM('07-12-2024'!$C3:$N3)
P3:P7P3=IFERROR(AVERAGE('07-12-2024'!$C3:$N3),"")
B10:C12B10=LET(Name,B3:B7,Tot,O3:O7,Avrg,P3:P7,curMonVal,XLOOKUP(UPPER(TEXT(TODAY(),"mmm. yy")),C2#,C3:N7,"N/A",0,1),deltaAV,IFERROR(ROUND(Avrg-curMonVal,0),0),crit,deltaAV>0,Result,FILTER(HSTACK(Name,deltaAV),crit),Result)
Dynamic array formulas.



Edit:
Please change the formulas to match your locale, e.g. "mmm. aa" instead of "mmm. yy"

Brilliant @PeteWright !!!🔝🔝💪
Have to test it more but so far so Perfect!!!

One last question, have to convert Portuguese months to Spanish months Language.
How can that be done in order that both formulas work well like the unique spill formula range "=TRANSPOSE(UPPER(TEXT(EDATE(EOMONTH(TODAY(),-12)+1,SEQUENCE(12,1,0)),"mmm. yy")))" and your Let formula?
If so can you give a hand?
Thank you very much Pete.👍👍🍻
 
Upvote 0
I'm not sure if I got you right.
Do you use multiple languages?

If you only need to make it work with one language just change all occurences of "mmm. yy" to "mmm. aa"
Should be the same in Portuguese and Spanish a for year and m for month.

Is that what you need?
 
Upvote 0
I'm not sure if I got you right.
Do you use multiple languages?

If you only need to make it work with one language just change all occurences of "mmm. yy" to "mmm. aa"
Should be the same in Portuguese and Spanish a for year and m for month.

Is that what you need?
Let me clarify @PeteWright

My Office 365 Excel is in default Portuguese Preference Language however my job sales data especially the months are in Spanish Language.
That´s why my question.
What should do.
Thanks again Pete.
 
Upvote 0
I see...

In Spanish it is Años (yy) and Meses (m) while in Portuguese it is Anos (aa) and Meses (m)

So you need a formula set that considers both, right?

Let me think...
 
Upvote 0
I think this is it:

Note the explicit language specific format [$-pt-PT] for Portuguese (Portugal)

MrExcel_2024-12.xlsm
BCDEFGHIJKLMNOP
1
2NAMESJAN. 24FEV. 24MAR. 24ABR. 24MAI. 24JUN. 24JUL. 24AGO. 24SET. 24OUT. 24NOV. 24DEZ. 24TOTALAVERAGE
3JOHN0 
4ANNA3010055101016027
5LISA10435033787510010
6MARIE505010020067
7ROB1234100888413815
8
9EXPECTED RESULTS
10ANNA17
11LISA5
12ROB11
07-12-2024
Cell Formulas
RangeFormula
C2:N2C2=TRANSPOSE(UPPER(TEXT(EDATE(EOMONTH(TODAY(),-12)+1,SEQUENCE(12,1,0)),"[$-pt-PT]mmm. yy")))
O3:O7O3=SUM('07-12-2024'!$C3:$N3)
P3:P7P3=IFERROR(AVERAGE('07-12-2024'!$C3:$N3),"")
B10:C12B10=LET(Name,B3:B7,Tot,O3:O7,Avrg,P3:P7,curMonVal,XLOOKUP(UPPER(TEXT(TODAY(),"[$-pt-PT]mmm. yy")),C2#,C3:N7,"N/A",0,1),deltaAV,IFERROR(ROUND(Avrg-curMonVal,0),0),crit,deltaAV>0,Result,FILTER(HSTACK(Name,deltaAV),crit),Result)
Dynamic array formulas.


Please select "accept solution" if this solves your problem. Thanks.
 
Upvote 0
So Beautiful @PeteWright 💪💪👍
Have to test it more however so far so Perfect!!!

Just some last arrangements, please update in your Let formula the possibility:

-Exclude List names even if meet criteria ("Marie"):
-Total in 3rd Column

Thank you very much Pete!!!! 🔝🔝💪💪🙏🍺🍺

Here is table.

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
10ANNA1778MARIE
11LISA5
12MARIE50
13ROB6
14
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:C13B10=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),Result)
D10D10=SUM(C10:C13)
Dynamic array formulas.
 
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