+ Reply to Thread
Results 1 to 2 of 2

using if/then and using sorting to parse data and create list without spaces

  1. #1
    Registered User
    Join Date
    09-17-2013
    Location
    nyc
    MS-Off Ver
    Excel 2010
    Posts
    3

    using if/then and using sorting to parse data and create list without spaces

    I am looking to use a sales database to create an invoice. i would like to use a y/n flag under an invoice column which would determine that an invloice would be populated with data for that customer from the sales database. there are many products and not always a sale of each item so there are lots of products that will need to be left off the invoice.

    What i would like is to create an invoice that lists the products purchased. i have included a sample of what the sales database looks like.

    The invoice will list the items vertically.
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: using if/then and using sorting to parse data and create list without spaces

    Try this...

    Enter this formula in cell A1 and copy across to B1:

    =IFERROR(VLOOKUP("y",$E12:$G19,COLUMNS($A1:A1)+1,0),"")

    Format cell B1 as Date

    Enter these column headers:

    C1 = Product
    D1 = Qty

    Enter this array formula** in C2:

    =IFERROR(INDEX(H$11:U$11,SMALL(IF(INDEX(H$12:U$19,MATCH(A$1,F$12:F$19,0),0)<>"",COLUMN(H12:U19)),ROWS(D$2:D2))-MIN(COLUMN(H12:U19))+1),"")

    Enter this array formula** in D2:

    =IFERROR(INDEX(H$12:U$19,MATCH(A$1,F$12:F$19,0),SMALL(IF(INDEX(H$12:U$19,MATCH(A$1,F$12:F$19,0),0)<>"",COLUMN(H12:U19)),ROWS(D$2:D2))-MIN(COLUMN(H12:U19))+1),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Select C2:D2 and copy down to a number of rows that is equal to the number of products you have. In your sample file there are 14 products so you'd need to copy the formulas to a total of 14 rows.

    Here's you file with these formulas implemented.

    sample list(1).xlsx
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] List of Valuses with Spaces and make a new list without spaces.
    By omallyfoster in forum Excel General
    Replies: 6
    Last Post: 05-21-2013, 08:14 AM
  2. Parse string with various length consecutive spaces
    By Excelvator in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2012, 07:43 PM
  3. Replies: 1
    Last Post: 06-10-2011, 06:32 AM
  4. Macro to parse a column with empty spaces
    By bearswentwild in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-14-2011, 01:02 PM
  5. Parse list of data to template in different worksheets
    By pmhabo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2010, 06:49 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