I am trying to write a code that will:
Sort elements (Call tri1) in an array - (note that the array proceeds from a range (dimension 10,1) of values in excel.
Create three intervals of size 2.
Assign each value to its corresponding interval.
Count the number of values in each interval, and hence, I will have the frequency.
I wrote this code, but it returns values that do NOT correspond to the number of occurrences. Would anyone be able to tell what I might be missing? Or maybe something is just plain wrong in the For Each loop with If .. Then statements?
The column of values I am working with on excel is:
2
3
4
5
7
8
1
2
4
1
And the bubble sorting:
Bookmarks