+ Reply to Thread
Results 1 to 10 of 10

make numbers in range into categories

  1. #1
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    make numbers in range into categories

    Hi all,

    I have a challenge which I hope you can help me with.

    I have a file with lots of sales per productID and I need to group them into the following:

    1-9 sales = S
    10-49 = M
    50-249 = L
    > 249 = XL

    It's in the excel file and the fomula in the yellow column should be based on whatever i type in G15:H18. This also means I might add one extra field and call this XXL, XS or the like.

    I hope you can help.

    thanks!
    Attached Files Attached Files
    Last edited by algl05ab; 07-15-2019 at 07:25 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,858

    Re: number between

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Re: number between

    Hi Ali,

    is it better now?

    I don't really know how to write a good headliner...

    br, Alexander

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,858

    Re: make numbers in range into categories

    Well, you do, because you just have. Thanks!

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,858

    Re: make numbers in range into categories

    Lay out the lookup table thus:

    Excel 2016 (Windows) 32 bit
    G
    H
    14
    Sales ranges by Company
    15
    1
    S
    16
    10
    M
    17
    50
    L
    18
    250
    XL
    Sheet: Page1_1

    Then, in C2 copied down:

    =VLOOKUP(B2,$G$15:$H$30,2,1)

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: make numbers in range into categories

    C2
    =lookup(b2,{0,1,10,50,250},{"";"S";"M";"L";"XL"})

  7. #7
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Re: make numbers in range into categories

    thanks for assistance so far. I have attached another file which perhaps better explains my challenge.

    So the categorization must be build on the sales volume that is in the Min and Max matrix. For instance is sales volume = 5 then it should be S, if 47 then M, if 76 then L and 1000 then XL. It should kinda be able to self-determine the category based on the min and max range i have defined (which i might change up- or downwards.

    thx
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,858

    Re: make numbers in range into categories

    That's exactly what my solution does. Try changing some of the numbers in your table in column B to test it. Did you even try it???

    Look:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    1
    Product
    Sales
    Range (S, M, L, XL)
    2
    1000
    0
    #N/A
    3
    1001
    3
    S
    4
    1002
    9
    S
    5
    1003
    10
    M
    6
    1004
    35
    M
    7
    1005
    50
    L
    8
    1006
    234
    L
    9
    1007
    110
    L
    10
    1008
    267
    XL
    11
    1009
    10,000
    XL
    Sheet: Page1_1

  9. #9
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Thumbs up Re: make numbers in range into categories

    works great! thanks!!!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,858

    Re: make numbers in range into categories

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macros to mark number in a column, if number is x+10, given previously marked number x.
    By aleem5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2015, 07:49 PM
  2. Replies: 1
    Last Post: 02-04-2015, 03:54 PM
  3. Replies: 10
    Last Post: 10-30-2013, 07:29 PM
  4. Validation Number number number + letter depending on numbers
    By Adamitus in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-31-2012, 04:28 AM
  5. number in cell is number to add number of rows wit copy some contex
    By nicollab in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2012, 08:09 AM
  6. Lookup largest number in a column treating negative number as postive number
    By xWiZardx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2010, 08:09 AM
  7. Replies: 7
    Last Post: 12-18-2008, 07:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1