Issue rearranging/sorting data based on multiple columns

BasicContract8989

New Member
Joined
Nov 8, 2023
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
I'm on Microsoft 2016 and my employer has asked that I sort some data for an upcoming audit, as I'm the only one in the building that can use Excel.

The data is organized like so:

ABCDEFGHIJKL
Last NameFirst NameLocationTitleTraining Date1Training Date2Training Date3Training Date4Training Date5Training Date6Training Date7Training Date8

These dates are stored in 2 separate places: an Excel sheet that we all have access to, and our HR software, which is updated (seemingly at random). This isn't ideal for anyone, but they won't budge on how this is done.

Our HR software can generate excel sheets with all the above data. I copy the data from the report and put in columns M-X.

MNOPQRSTUVWX
Report Last NameReport First NameReport LocationReport TitleReport Date1Report Date2Report Date3Report Date4Report Date5Report Date6Report Date7
Report Date8

I also used a formula (
=IF(A2=M2, "Match","Not Match")) in a series of columns just to the right of all these rows to confirm that the HR report and the Spreadsheet are matching. This usually goes off without a hitch and I run the audit of 400+ employees (400+ rows) at lightning speed.

Here's the issue:
The manager in our HR software broke their report and they don't know how to fix it. The report spews out the above information in the correct columns, but in entirely the wrong row. There's no cohesion to it at all. This means my Match formula always reads each full row from A-X as mismatched because the M-X columns always come out in the wrong order. Also note: they come out different every time, so I can't just rearrange my excel sheet for the one Report, because the next one will be different.

I really don't want to manually go in and move all the A-L columns around to line up with the M-X columns, but I can't come up with a solution to do it any other way. This forum is my last resort.

I have tried unreliable AI, various formulae and macros posted on this very forum, and I even went to Microsoft Support (who's answer was "...huh?").

My Question:
Is there a way to build a macro or formula that will read columns A and B, find their match in column's M and N, and then move the row from A-L to line up with M-X?

The closest I got was a macro that moved things around, but ended up erasing the row they subsumed and leaving the space they came from totally blank.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Well, I just found the easiest possible solution ever....

Step 1: Highlight columns A-L
Step 2: Sort Data by Column A, then Column B.
Step 3: Highlight columns M-X
Step 4: Sort Data by Column M, then Column N.
Step 5: put this all in a macro so it does it on its own.
Step 6: quit your job
 
Upvote 0
Solution

Forum statistics

Threads
1,223,849
Messages
6,175,005
Members
452,600
Latest member
nicoCrous75

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top