How to get the count, average, and stdev of numbers in rows of a range that correspond to a particular row identifier?

Rnkhch

Well-known Member
Joined
Apr 28, 2018
Messages
578
Office Version
  1. 365
Platform
  1. Windows
Hello,

I thought this would be simple, but I'm probably missing something small :biggrin:. I have a few rows of numbers, and at the leftmost cell of each row, there is a row identifier (attached XL2BB). In this example, I'm trying to get the count, average, and stddev of all the numbers that are on the rows that correspond to "A", and I was hoping to do this with formulas that do not require control+shift+enter (I'm trying to avoid control+shift+enter because on large datasets that I typically receive, they slow down the workbook). But so far anything I tried didn't work (even with control+shift+enter) 😁:


Book1
ABCDEFGHI
1
2A2465.5
3B345
4A678#DIV/0!0
5#DIV/0!0
6#DIV/0!0
7
Sheet1
Cell Formulas
RangeFormula
G2G2=AVERAGE(B2,C2,D2,B4,C4,D4)
G4:G6G4=AVERAGEIF(B2:D4,A2:A4="A")
H4:H6H4=COUNTIF(B2:D4,A2:A4="A")
Dynamic array formulas.


Thanks for any input!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
P.S. I forgot to mention in my original post that some of the cells in the data range may be blank (blanks from other formulas that evaluate to blank, not just plain blanks), so that makes things a bit more complex :biggrin:
 
Upvote 0
How about
Excel Formula:
=AVERAGE(FILTER(B2:D4,A2:A4="A"))
 
Upvote 0
Solution
Yes, incredible, that's exactly what I needed! Thanks much! I also checked the COUNT and STDEV versions of your formula, and they work very well:

=COUNT(FILTER(B2:D4,A2:A4="A"))
=STDEV(FILTER(B2:D4,A2:A4="A"))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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