Vai al contenuto principale

Come calcolare la media delle celle in base a più criteri in Excel?

In Excel, la maggior parte di noi potrebbe avere familiarità con le funzioni CONTA.SE e SOMMA.SE, possono aiutarci a contare o sommare i valori in base a criteri. Ma hai mai provato a calcolare la media dei valori in base a uno o più criteri in Excel?

Celle medie basate su un criterio con la funzione Averageif

Celle medie basate su più criteri con la funzione Averageif


freccia blu freccia destra Celle medie basate su un criterio con la funzione Averageif

Supponendo di avere il seguente intervallo di dati, la colonna A è l'elenco del prodotto e la colonna B è gli ordini, ora, farò la media delle celle dell'ordine in cui il prodotto è KTE.

doc-avergae-con-criteri-1

Inserisci questa formula nella cella desiderata: =AVERAGEIF(A2:A19,D2,B2:B19), (A2: A19 sono i dati che contengono i criteri, B2: B19 si riferisce all'intervallo che si desidera calcolare nella media e D2 è il criterio su cui si desidera calcolare la media dei valori) e premere entrare tasto per ottenere il risultato, vedi screenshot:

doc-avergae-con-criteri-2


freccia blu freccia destra Celle medie basate su più criteri con la funzione Averageif

Se desideri calcolare la media con più criteri, il file MEDIA.PIÙ.SE la funzione può aiutarti.

La sintassi di Averageif come segue:

AVERAGEIFS (intervallo_media, intervallo_criteri1, criteri1, intervallo_criteri2, criteri2 ...)

  • Intervallo_media: è l'intervallo di celle da calcolare nella media;
  • Criteri_range1, intervallo_criteri2,… Sono gli intervalli in cui valutare i criteri associati;
  • Criteri 1, criteri 2, ... sono criteri su cui ti basi.

Prendi i dati sopra per esempio, ora, voglio fare la media dell'ordine di KTE e dell'ordine maggiore di 500. Per favore, fai come segue:

Inserisci questa formula in una cella vuota: =AVERAGEIFS(B2:B19,A2:A19,E1,B2:B19,">500")( A2: A19 sono i dati che contengono i criteri1, B2: B19 si riferisce all'intervallo che vuoi calcolare nella media, E1 ed > 500 sono i criteri1 e i criteri 2), quindi premere entrare tasto per ottenere il risultato desiderato. Vedi screenshot:

doc-avergae-con-criteri-3

Nota: Se hai più di due criteri che desideri, devi solo aggiungere gli intervalli di criteri ei criteri di cui hai bisogno come segue: = AVERAGEIFS (C2: C19, A2: A19, F1, B2: B19, F2, C2: C19, "<500"), (A2: A19 ed F1 sono la prima gamma di criteri e criteri, B2: B19 ed F2 sono la seconda gamma di criteri e criteri, C2: C19 ed <500 sono la Terzo gamma di criteri e criteri, C2: C19 si riferisce alla gamma Tu voglio fare la media dei valori), vedi screenshot:

doc-avergae-con-criteri-4


Articoli correlati:

Come calcolare la media dei 3 valori superiori o inferiori in Excel?

Come calcolare la media degli ultimi 5 valori di una colonna quando vengono inseriti nuovi numeri?

Come calcolare la media ogni 5 righe o colonne in Excel?

I migliori strumenti per la produttività in ufficio

🤖 Assistente AI di Kutools: Rivoluziona l'analisi dei dati basandosi su: Esecuzione intelligente   |  Genera codice  |  Crea formule personalizzate  |  Analizzare i dati e generare grafici  |  Richiama le funzioni di Kutools...
Funzioni popolari: Trova, evidenzia o identifica i duplicati   |  Elimina righe vuote   |  Combina colonne o celle senza perdere dati   |   Round senza formula ...
Super ricerca: VLookup a criteri multipli    VLookup a valori multipli  |   VLookup su più fogli   |   Ricerca fuzzy ....
Elenco a discesa avanzato: Crea rapidamente un elenco a discesa   |  Elenco a discesa dipendente   |  Elenco a discesa a selezione multipla ....
Gestore di colonna: Aggiungi un numero specifico di colonne  |  Sposta colonne  |  Attiva/disattiva lo stato di visibilità delle colonne nascoste  |  Confronta intervalli e colonne ...
Funzionalità in primo piano: Messa a fuoco della griglia   |  Vista di progettazione   |   Grande barra delle formule    Gestore di cartelle di lavoro e fogli   |  Resource Library (Testo automatico)   |  Date picker   |  Combina fogli di lavoro   |  Crittografa/decrittografa le celle    Invia e-mail per elenco   |  Super filtro   |   Filtro speciale (filtro grassetto/corsivo/barrato...) ...
I 15 migliori set di strumenti12 Testo Strumenti (aggiungi testo, Rimuovi personaggi, ...)   |   50+ Grafico Tipi (Diagramma di Gantt, ...)   |   40+ Pratico Formule (Calcola l'età in base al compleanno, ...)   |   19 Inserimento Strumenti (Inserisci il codice QR, Inserisci immagine dal percorso, ...)   |   12 Conversione Strumenti (Numeri in parole, Conversione di valuta, ...)   |   7 Unisci e dividi Strumenti (Combina righe avanzate, Celle divise, ...)   |   ... e altro ancora

Potenzia le tue competenze di Excel con Kutools per Excel e sperimenta l'efficienza come mai prima d'ora. Kutools per Excel offre oltre 300 funzionalità avanzate per aumentare la produttività e risparmiare tempo.  Fai clic qui per ottenere la funzionalità di cui hai più bisogno...

Descrizione


Office Tab porta l'interfaccia a schede in Office e semplifica notevolmente il tuo lavoro

  • Abilita la modifica e la lettura a schede in Word, Excel, PowerPoint, Publisher, Access, Visio e Project.
  • Apri e crea più documenti in nuove schede della stessa finestra, piuttosto che in nuove finestre.
  • Aumenta la produttività del 50% e riduce ogni giorno centinaia di clic del mouse!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, I'm trying to create an average only if the row meets criteria in other columns. I need to only include the number in column J if that row has a "B" in column F and a "M" in column E. I've worked out the formula if it's only one condition:

=AVERAGEIF(F2:F114, "B", J2:J114)

But I can't work out how to get it to only average numbers in column J that meet both conditions?
This comment was minimized by the moderator on the site
Hello, Sally
To calculate the average based on multiple criteria, you can apply the AVERAGEIFS function, please use the below formula:
=AVERAGEIFS(J2:J114, F2:F114, "B", E2:E114, "M" )

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Thanks so much, this worked perfectly!
This comment was minimized by the moderator on the site
What formula would I use if I wanted to get my averages for a month but not count the days that are zero (0)? I am keeping track of my monthly electric usage but need to get an average even before the end of the months. Any ideas or help?
This comment was minimized by the moderator on the site
Hello, TFkidd
To solve your problem, please apply the below formula:
=AVERAGE(IF(B2:B31<>0,B2:B31))
Please try, hope it can help you!
This comment was minimized by the moderator on the site
Hi there
I am trying to calculate percentage of people from across 4 regions (entered in column b)
and percentage by ethnicity (entered in column D)
I can calculate the average age and percentage of ages, but I can't seem to find a formula to calculate the regions and ethnicity. Any suggestions would be appreciated, thanks Tracy
This comment was minimized by the moderator on the site
To get an average of data in a column with multiple criteria the following formulae may be used.

Syntax = AVERAGEIFS (Range, Range 1, criteria 1, range 2, criteria 2)

In this case, my requirement is to find the average of the data in a range of numbers, without considering '0 - Zero' & values greater that '3000'.

Total data in the range is 31 nos ,

And the formulae will be

=AVERAGEIFS(G5:G35,G5:G35, "> 3000", G5:G35,"<>0")
This comment was minimized by the moderator on the site
I have 4 variables: 1st: Date of onset, 2nd: Date of termination, 3rd: Date of measurement, 4th: measurement. I want to calculate the average of the 4th variable between each period of onset-termination. How can i do it? I think its a bit tricky. Each date of onset has an counterpart date of termination. The same applies for the 3rd and 4th variable.
How can i make this happen?
This comment was minimized by the moderator on the site
VBA code to average one or more ranges of nonzero numbers:


Option Explicit
Function avgNonZeros(ParamArray rangeList() As Variant) As Variant
'Returns the average for all nonzeros of rangeList.
'rangeList may be one or multiple ranges.
Dim cell As Range
Dim i As Long
Dim totSum As Long
Dim cnt As Long
DoEvents 'allows calculations prior to performing
avgNonZeros = 0 'default return
For i = LBound(rangeList) To UBound(rangeList)
For Each cell In rangeList(i)
If cell <> 0 Then
totSum = totSum + cell
cnt = cnt + 1
End If
Next cell
Next i
If cnt <> 0 Then avgNonZeros = totSum / cnt
End Function
This comment was minimized by the moderator on the site
Hi,
I have 200 observations. I need to get an average of 21st to 40th observations. I am struggling to set an averageif formula. Any suggestion will be appreciated.
This comment was minimized by the moderator on the site
I have a similar problem like example #3, but the difference is that I need the average between two dates instead of for a single month. Any suggestion?
This comment was minimized by the moderator on the site
Hello, Crist,

To solve your problem, please apply the below formula:
=AVERAGEIFS(C2:C15, A2:A15, F1, B2:B15, ">=" &F2, B2:B15, "<=" &G2, C2:C15, ">300")

Please try, hope it can help you!
This comment was minimized by the moderator on the site
Hi there,


My is Pablo and I would like to ask you about this situation. I have got a column with several values and some of them are zeros. As they are dB measurements this is the array formula I use to get the average: =10*LOG(AVERAGE(10^(C3:C66/10)))

My problem is that I am trying to get with a formula that does not take in account the zeros.

I have tried the next formula but it seems that does not work for my situation: =10*LOG(AVERAGEif(C3:C66,"<>0",[10^(C3:C66/10)]))

It would be very apprecited if you could give me a hint to solve this problem.

Thank you in advance,

Pablo.
This comment was minimized by the moderator on the site
I want to take numbers in multiple columns and combine them into one average. I have three columns to average, I want two of the columns to count for 40% each and the remaining column to count for 20%. Is this possible? Thanks!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations