Consolidating in excel

ctjacobs2010

Board Regular
Joined
Dec 12, 2013
Messages
56
If I need to choose (Column B) from a list of numbers (Column A). How do I consolidate the numbers in column B to look like column C> See below for example:



Column A Column B Column C
3216549871 1 3216549871
7894561232 5468949745
5468949745 1 6546548845
6352418497 2255454545
2316548974
6549879871
3213212134
6546548845 1
9875588545
2255454545 1

I dont mind if helper cells are needed, but I dont wan to use macros if I dont need to. Thank You :)
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Column A Column B Column C
321654987113216549871
78945612325468949745
546894974516352418497
635241849713213212134
2316548974
6549879871
32132121341
6546548845

<tbody>
</tbody>

















Hopefully you can see this better
 
Upvote 0
Try the below with adding 2 helper columns … I think the same could be achieve without any helper columns using array formulas (which I am still not good at :LOL:)

C2 : =IFERROR(IF(VLOOKUP(E2,D:E,2,0)=0,0,OFFSET($A$1,VLOOKUP(E2,D:E,2,0),0)),0)
D2 : =SUM($B$2:B2)
E2 : =ROWS($A$2:A2)

Column AColumn BColumn CColumn DColumn E
32165498711321654987111
7894561232546894974512
54689497451635241849723
63524184971321321213434
2316548974035
6549879871036
32132121341047
6546548845048

<tbody>
</tbody>


Or if interested, you can use the below VBA code without any helper columns

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim lRowA As Double, lRowC As Double
lRowA = Range("A" & Rows.Count).End(xlUp).Row

If Not Intersect(Target, Range("B2:B" & lRowA)) Is Nothing Then
    Range("C2:C" & lRowA).ClearContents
    lRowC = 2
    For x = 2 To lRowA
        If Cells(x, 2) = 1 Then
            Cells(lRowC, 3) = Cells(x, 1)
            lRowC = lRowC + 1
        End If
    Next x
End If

End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,593
Messages
6,125,716
Members
449,254
Latest member
Eva146

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