• Dynamic list with no spaces (Excel 2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Dynamic list with no spaces (Excel 2003)

    Author
    Topic
    #456045

    I need to create a list of items selected from a table of data. An item is selected if its quantity > 0. The selected items are used to populate another element however I need it to not include spaces. The attached sample works with a simple IF statement but I need to get rid of the spaces for those unselected items. Since I’m importing this into another tool, I can’t use a solution that requires VBA.

    ModelA  Qty 2
    ModelB  Qty 0
    ModelC  Qty 1

    So the output in another table (elsewhere on the worksheet) should be:

    ModelA
    ModelC

    I also can’t just sort it (to get rid of the empty lines), since that’s a manual step, it needs to be done through lookups and/or matching if possible.

    Thnx, Deborah

    Viewing 2 reply threads
    Author
    Replies
    • #1137860

      If you have ModelA etc in column A and 2;0;1 in column B,
      Selecting three cells in a column and entering the array formula

      =INDEX(A:A,SMALL(IF(B1:B30,ROW(B1:B3),999),ROW(Z1:Z3)),1)&””

      should do what you want.
      The B1:B3 can be changed to start in some row other than 1, but the Z1:Z3 range must start in row 1, its purpose is to generate the array {1;2;3…}

      Array formulas need to be confirmed with Ctrl-Shift-Enter (Cmd+Return for Mac)

      • #1138023

        Excellent work to everyone who replied. There is no way I could ever of figured this one out. Great job.

        thankyou bow thankyou
        Deb

    • #1137982

      Hi Deborah

      The attached example is provided just in case you have some trouble expanding Mike’s solution to a larger range of input.

      Thanks to Mike for the insight; I was labouring with a MUCH more involved solution.

    • #1137991

      Is the attached something like you are after?

      I added some cond formatting to color the selections….

      Steve

    Viewing 2 reply threads
    Reply To: Dynamic list with no spaces (Excel 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: