How to count the data in ranges for compass points
=countif(v4:v800, ""&22.5) - countif(v4:v800, ""&67.5)
would count everything greater than 22.5 and less than or equal to 67.5.
You'd have to think about if you want to include or exclude values that are
exactly 22.5 or exactly 67.5.
"="&22.5 will include 22.5 in the count
""&22.5 will exclude 22.5
""&67.5 will include 67.5
"="&67.5 will exclude 67.5
or try sumproduct, which may be more intuitive
=Sumproduct(--(v4:v80022.5), --(v4:v800<67.5))
to count everything between 22.5 and 67.5. Changing the comparison
operators to = and <= will include 22.5 and 67.5 respectively.
"WM" wrote:
Hi,
Can someone help me write the syntax that will correctly count the data in
ranges for compass points...
Something like this:
=countif(v4:v800, "22.5") +? or -? countif(v4:v800, "<67.5") etc
would equal northeast
=countif(v4:v800, "67.5") -? countif(v4:v800, "<112.5") would equal
east....but this is where it goes wrong. One can only apply the second
argument to the range that goes down to the first.
Sanity check: after going through the range of compass points the sum of the
results should be 796.
Compass points (it make sense when you draw a circle and mark off the
segment ranges):
N 337.5 to 22.5
NE 22.5 to 67.5
E 67.5 to 112.5
SE 112.5 to 157.5
S 157.5 to 202.5
SW 202.5 to 247.5
W 247.5 to 292.5
NW 292.5 to 337.5
Natalie.
|