Home » excel » excel – How do I get a single number and seperate it into multiple groups

excel – How do I get a single number and seperate it into multiple groups

Posted by: admin May 14, 2020 Leave a comment

Questions:

say I have a number

250,000

And I have a dynamically changing group:

  • group 1 – 0 to 100,000
  • group 2 – 100,001 to 200,000
  • group 3 – 200,000
    onwards

Is there a formula where I can split it up this way in that the first 100,000 goes into the first group, then the next 150,000 goes into the second group, and the third group is empty.

I’ve been trying with If statements, and the first group is easy, but the second one I try to subtract from the first, but only after I check its higher then the max of group 1 and everythings starts breaking.

Thanks so much.

How to&Answers:

This is the formula everybody has been talking about. The value is in A2.

=4-MATCH(A2,{100000000,200000,100000,0},-1)

Note that 100,000,000 is an arbitrary high number intended to be larger than any you will ever have to sort. The array must be sorted in descending order.

Answer:

To mirror BigBen’s comment, you need to do a =MATCH(). Instead of the match_type being 0 (exact), you can change it to 1 or -1 depending on your needs.