Excel Add Columns With Same Header - 2362

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Aug 31, 2020.
Today's Excel question from Rico: How to combine columns that have the same header? I first use Consolidate and then a formula solution using UNIQUE and SUMIFS. Although - I discover a new bug in Consolidate.
maxresdefault.jpg


Transcript of the video:
Learn Excel from MrExcel Podcast Episode 2362.
Add columns that have the same header.
Hey, welcome back to the MrExcel netcast. I am Bill Jelen.
I know I am being set up here. This question is from Rico on YouTube.
How to group columns with the same header?
Here - we have two columns that have the header 2.
He wants to take zero plus one to get one.
One plus zero to get one.
And so on.
Here are my two ways.
The easy way.
This is old-school, going back to 1993.
Data, Consolidate. That is Alt+D N.
Specify the Reference including the headers.
And I say that I want to use the Labels only in the Top Row.
Click OK. It gives me 1, 2, 3, 4, 5.
It collapses them down.
And here where I have zero plus one, I get one.
One plus one, I get two.
This is fast and easy. The problem is: if this data changes, The Consolidate does not change.
You have to update it.
And, there is a new bug. There never used to be this bug.
If I come back in here with Alt+D, N.
And click OK, it only updates the first column.
So I have to clear it out and then Alt+D N.
And click OK.
[ Sigh ] [ Ugh ] Super annoying.
Here is a two formula solution.
The first formula is =UNIQUE(.
Of the headers here.
I will say that "by column" is True.
Click OK and I get the numbers 1 through 5.
And then it is straight-forward from there.
=SUMIFS(. What do we want to sum? The numbers in this row.
I am going to press F4 not just once.
I want to lock it down to the columns but not the rows.
The rows need to be able to move.
Press F4 three times.
For the criteria range, look through the header row.
In this case, I need that reference to stay in that row, so press F4 to put all the dollar signs in.
And then, I think I can do this all in one.
If I point to this cell. V4 with a dollar sign before the 4.
So I press F4 two times. And then type a Hash.
The hash indicates the whole array generated by the UNIQUE.
Close paren.
I get the answers for the first one and then copy it down.
If you are watching this, be sure to check the YouTube comments below.
Rico probably has an awesome single-formula solutions. Because that is what Rico likes to do.
Check out my book, MrExcel 2020 Seing Excel Clearly. Click the (i) in the top right corner.
If you want to know new Excel features first, click Subscribe down below the video.
I pride myself on being the first to show you new features in Excel.
Plus some Q&A like this.
Also, Like and Ring that bell.
Feel free to post any questions or comments in the Comments section below.
I want to thank Rico for sending that question in. I can't wait to see what answer he has.
And thank you for stopping by. We will see you next time for another netcast from MrExcel.
 

Forum statistics

Threads
1,221,544
Messages
6,160,432
Members
451,646
Latest member
mmix803

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