Combine cells conditionally

tigerzen

Board Regular
Joined
Mar 8, 2023
Messages
209
Office Version
  1. 365
Platform
  1. Windows
Book4
ABC
2Tom Tom
3JonesJones Tom
4FrancisNext 
5AlbertAlbert
6JohnJohn Albert
7SinatraSinatra John Albert
8PeterNext 
9StevenSteven
10TownsendTownsend Steven
11MichaelNext 
12VV
13JacksonJackson V
14
15Desired
16Tom
17JonesTom Jones
18FrancisNext
19Albert
20John
21SinatraFrancis Albert John Sinatra
22PeterNext
23Steven
24TownsendPeter Steven Townsend
25MichaelNext
26V
27JacksonMichael V Jackson
Sheet3
Cell Formulas
RangeFormula
C2:C13C2=IF(B2="",A2&" "&C1,"")

Data is received as per attached information. Column C indicates what needs to happen, I have attempted a solution which doesn't work, it is incomplete and returns the name in the wrong order. Looking for a formula here that will do the job, please note that I'm assisting someone who only has Excel 2016 thus no Textjoin function which may or may not impact on the solution.
 
Change C2 to =IF(B2="Next", A2, CONCATENATE(C1, " ",A2))
Is there any advantage or reason to change from
=IF(B2="Next",A2,C1&" "&A2)
to the longer
=IF(B2="Next", A2, CONCATENATE(C1, " ",A2))
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
He asked about older versions of Excel which do not accept joining using &
 
Upvote 0
Just giving the option
That's fair enough - but quite different to the statement in post #12. And post #10 sounds like an instruction to change, not simply an option. ;)

Anyway, it seems that the OP has a satisfactory result earlier than all that and that is the main thing. :)
 
Upvote 0
Thank you everyone who has contributed to this solution. Helper columns fine as they can always be hidden.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,812
Members
452,945
Latest member
Bib195

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