How to determine the number of cells in a range that are not empty?

Rnkhch

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

I do a lot of calculations involving ranges, but I realized I get erroneous results depending on whether all or some of the cells in the range contain numbers. Here is a hypothetical example:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]STDEV[/TD]
[TD]STDEV/n[/TD]
[/TR]
[TR]
[TD]83[/TD]
[TD]78[/TD]
[TD]96[/TD]
[TD]92[/TD]
[TD]91[/TD]
[TD]85[/TD]
[TD]90[/TD]
[TD]6.148944935<strike></strike>[/TD]
[TD]<strike></strike>0.878420705<strike></strike>[/TD]
[/TR]
[TR]
[TD]79[/TD]
[TD]70[/TD]
[TD]82[/TD]
[TD]90[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]8.261355821<strike></strike>[/TD]
[TD]<strike></strike><strike></strike>1.180193689<strike></strike>[/TD]
[/TR]
[TR]
[TD]67[/TD]
[TD]79[/TD]
[TD]80[/TD]
[TD]78[/TD]
[TD]83[/TD]
[TD]76[/TD]
[TD][/TD]
[TD]5.492419018<strike></strike>[/TD]
[TD]<strike></strike>0.784631288<strike></strike>[/TD]
[/TR]
[TR]
[TD]etc.[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Here I divide the STDEV numbers by n=7 (which is the case for the first row), but n is not 7 in all rows. So, how could I write a formula that would know what the n is for each row (ideally without the need for VBA :) )?

Thanks a lot for any input!

And Happy New Year :)
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi,

How about:


Book1
ABCDEFGHI
1837896929185906.1489450.878421
2797082908.2613562.065339
36779807883765.4924190.915403
Sheet441
Cell Formulas
RangeFormula
H1=STDEV(A1:G1)
I1=STDEV(A1:G1)/COUNT(A1:G1)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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