user84592
user84592

Reputation: 4882

Excel how to calculate occurrences in a range

I have following column /1/, what I want to calcuate the occurrences of range,for example [1,2),[2,3),[3,4),[4,max) in the example/1/, the occurrences of [1,2) is 1, and [2,3) is 2.... How to write excel formular?

/1/
Weight
1.1
2.2
3.1
4.2
2.1
3.2
4.5
5.1

Upvotes: 1

Views: 97

Answers (1)

aardvarkk
aardvarkk

Reputation: 15996

I used a combination of IF, AND, LT/LTE and GT/GTE to get the following demo in Google Sheets. You can change the values in Range Min and Range Max to see the results. The relevant formula is something like:

=IF(AND(GTE(val,range_low),LT(val,range_high)),1,0)

Then just sum them up!

If you wish to change between closed/open intervals you can just switch LT for LTE and GT for GTE as necessary.

Upvotes: 1

Related Questions