+ Reply to Thread
Results 1 to 11 of 11

Matching and realign column contents

  1. #1
    Registered User
    Join Date
    04-10-2015
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    5

    Matching and realign column contents

    Hi All,

    I have a spreadsheet with 4 columns :

    A = invoice numbers
    B = invoice values
    C= invoice numbers
    D = invoice values

    Columns A&B are List 1.
    Columns C&D are List 2.

    Column A and Column C contain have invoices that match and also other invoices that do not match.

    I wish to have the invoice numbers in List 1 and List 2 sorted so that matched invoice numbers appear in the same row and thus I can check whether their respective invoice values also match.

    I also need any unmatched invoices to remain in their respective columns, so that I can investigate further.

    What I was going to do was to sort the two lists and then manually match them through cutting and pasting the two columns downwards so that matched invoice numbers appear in the same rows.

    Can anyone suggest a quicker way of doing this?

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,789

    Re: Matching and realign column contents

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Matching and realign column contents

    See if attached helps.

    Note values in Columns A & B are random generated, they will change (as will dependent cells) every time the sheet is re-calc'd.
    Last edited by jhren; 04-11-2015 at 08:55 PM. Reason: Deleted File

  4. #4
    Registered User
    Join Date
    04-10-2015
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    5

    Re: Matching and realign column contents

    Matching sample.xlsx

    Sample attached.

    In my sample, there are blanks in each column for invoice numbers out of sequence. If this is not possible through automation, I do not mind all the unmatched invoice numbers in each column remaining out of sequence.

    Thanks.
    Last edited by APHK; 04-11-2015 at 06:14 AM.

  5. #5
    Registered User
    Join Date
    04-10-2015
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    5

    Re: Matching and realign column contents

    Sorry if my explanation of what I wanted was not clear in my original post. I need the matched invoice numbers to remain in the same row.

  6. #6
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Matching and realign column contents

    I can get close. The method results in two rows of same invoice number and values. Perhaps someone knows how to get around it...
    Last edited by jhren; 04-11-2015 at 05:55 PM. Reason: deleted file

  7. #7
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Matching and realign column contents

    Slight improvement...

    First of the two duplicate rows is now a blank row... and non-matching values with the same invoice number are highlighted (red fill, white text).
    Last edited by jhren; 04-11-2015 at 08:54 PM. Reason: Deleted File

  8. #8
    Registered User
    Join Date
    04-10-2015
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    5

    Re: Matching and realign column contents

    @jhren, that is very interesting thanks. However, when I tried replacing the short list in the original sample with a much longer list the results I get from the formula remain short eventhough I copied the formula all the way down.

    Please see attached.
    matching-and-realign-column-contents_APHK.xlsx

  9. #9
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Matching and realign column contents

    Expand the named ranges (Formulas>Name Manager). Highlight one at a time each of the four named ranges and edit the last cell row number (e.g. num_1.1 from =Sheet1!$A$4:$A$11 to =Sheet1!$A$4:$A$294 in "Refers to:" ...then press Enter (any activity outside the box should invoke a prompt to save changes; pressing Enter is just quicker). You can also change the last cell row to some exorbitant number if you want... like 10000 (or more).
    Last edited by jhren; 04-11-2015 at 08:33 PM.

  10. #10
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Matching and realign column contents

    Also found conditional formatting errors. Happens without warning when "moving" stuff around. Haven't got the gist of how/when it happens myself. Just happen to notice same invoice number having different values.
    Last edited by jhren; 04-11-2015 at 08:58 PM.

  11. #11
    Registered User
    Join Date
    04-10-2015
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    5

    Re: Matching and realign column contents

    Great. That is the kind of result I am looking for. Many thanks for taking the time.

+ 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. Delete Rows that contain matching cell contents in column to the contents in cell B1
    By sspatriots in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2015, 05:39 PM
  2. Replies: 7
    Last Post: 12-17-2014, 01:31 AM
  3. [SOLVED] Realign Column Data into Row Data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-15-2013, 06:25 PM
  4. Replies: 2
    Last Post: 04-11-2013, 11:14 AM
  5. How to realign data in columns to rows?
    By Dougie12. in forum Excel General
    Replies: 4
    Last Post: 02-27-2012, 06:17 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