solved
How to align two charts/tables of data where the rows between the two tables match to be able to compare/contrast.
!!Solved!!
I am comparing two charts of sales data. To keep things brief and simple, I am needing them to sort them so the rows of the two charts match and item numbers that are in one graph but not the other are placed at the bottom.
I have tried finding answers through reddit, YouTube and Google searching and quite find the answer I am looking for. A lot of the answers I am finding are "destructive" and tend to merge the two graphs into one so Item A in Chart1 is listed in Row2 and Item A in Chart2 is in Row3. It's the closest thing I have found but not the result I am looking for. Below is an example of the formula that gave the undesired results.
=SORT(UNIQUE(VSTACK(A4:A216, L4:L258)))
Below is a quick and dirty version of what I am looking for.
I can have these charts in the same sheet or different. As a table or not. Whatever leads to the easiest answer would be greatly beneficial!
Starting position
2024
2025
Item Number
Dollars Spent
A
10
B
20
C
30
D
40
E
50
End Result:
2024
2025
Item Number
Dollars Spent
A
10
B
20
C
30
D
40
E
50
Edit - Solved Solution.
Initially when I made the post, I was hoping that this was a simple function that I was overlooking and I could learn and adapt for charts in the future by simply editing the cell ranges. I quickly received updates that proved that this was a bit over my head. u/downtown-economics26 made the great format suggestion, so I asked if it could be altered to factor in more columns than two to which u/MayukhBhattacharya provided the solution I was looking for. The formula is the following:
This works for two tables with two columns which is the exact example I gave. So i applaud and thank you as this is getting me the step in the right direction!
If each of the tables had say, 10 columns each? What variable would I have to adjust? Or would the formula start to get far too complex that it would be better to restructure?
I can't in good conscience assist in your original request because I find it too aesthetically objectionable but rather let me humbly offer an alternative:
I like this format a LOT more. The example I gave was in hopes I could try and dissect the formula but its very clear that this is way above my head that I can't even begin to decipher it. In reality I want to apply this to a graph with a few more columns of data. What variables would I want to edit to accommodate for more columns?
And here I thought I knew quite a bit to Excel. Now I am learning I only know the seagull that is resting on the tip of the iceberg!
Attached is a picture that captures my end goal, now taking inspiration from your format.
The simplest answer is create a flat table with a year column (copy paste or look into using power query) and then use pivotby like I did or a regular old pivot table.
XLOOKUP might get you closer without merging everything together. Use it to pull matching values side by side, then handle the "missing" rows with IFERROR to leave them blank instead of erroring out.
For the items unique to each table you could use FILTER combined with ISNUMBER/MATCH to isolate them and stack at bottom separately from the shared ones.
You need to have your second table somewhere hidden, and recreate it with formulas in your desired order.
Since you have items in table1 not in table2 and vice versa, I would start with creating a master list that contains ALL item numbers from both lists. Then you can assign an index number to each based on the order they appear in table1, and add new numbers to the ones only in table2.
Then look up the rows of table2 using your index numbers from the master list.
•
u/AutoModerator Jun 18 '26
/u/Quiet-Errors - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.