+ Reply to Thread
Results 1 to 2 of 2

Line-up Columns by Sort and Leaving Blanks for no data.

  1. #1
    Registered User
    Join Date
    07-11-2011
    Location
    Santa Clara, CA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Red face Line-up Columns by Sort and Leaving Blanks for no data.


    Hello everyone,

    Please help in on how to do this process: I have two lists, each has an index to sort and matching data. In the following example, WW and YY will be the sortable categories, and XX and ZZ will be the data:

    WW_______XX_______YY_______ZZ
    A________1________B________11
    B________2________C________12
    D________3________D________13
    E________4________F________14
    G________5________H________15
    H________6________I________16
    J________8________K________17
    K________9________L________18
    M________10_______M________19
    N________11_______N________20

    What I need to do, is sort it out so that the matching categories line up horizontally, and if either column is missing a category, it would leave a blank. So it would turn out something like this: (Column XX+ZZ is what I'd like to do).


    WW_______XX_______YY_______ZZ________XX+ZZ
    A________1___________________________1
    B________2________B________11________13
    __________________C________12________12
    D________3________D________13________16
    E________4___________________________4
    __________________F________14________14
    G________5___________________________5
    H________6________H________15________21
    __________________I________16________16
    J________8___________________________8
    K________9________K________17________26
    __________________L________18________18
    M________10_______M________19________29
    N________11_______N________20________31

    Right now, my process is manually inserting entire rows to make up for the missing categories (ie, C, F, I, and L from Column YY) so the data lines up nicely.

    If you want to know what I'm really doing, I'm an accountant that needs to sum horizontally over 100's of accounts, so manually inserting rows just to line up data can be painstaking at times.

    Any help is GREATLY appreciated, thank you.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Line-up Columns by Sort and Leaving Blanks for no data.

    here's one way
    and you have excel 2007 so use if error instead of isna
    =IF(ISNA(VLOOKUP(E2,$A$2:$B$11,1,FALSE)),"",VLOOKUP(E2,$A$2:$B$11,1,FALSE))
    becomes
    =iferror(VLOOKUP(E2,$A$2:$B$11,1,FALSE),"")
    Attached Files Attached Files
    Last edited by martindwilson; 07-11-2011 at 07:39 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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