Concatenate and add a condition for blank cells

Boubiche

New Member
Joined
Jan 27, 2016
Messages
14
Office Version
  1. 365
Platform
  1. Windows
I have a question and I hope I am able to formulate it right. I've tried but cant seem to get it to work.

I have a bunch of activities (Column A) with different options of classes

I want cells in D:D to concatenate the different classes, (in column B and C), however, for some of the activities, there is no option of class.. so these B & C are empty. In column D, for that activity, the return is blank.

It is possible to either:
  • To add a text to blank D:D cells?
  • concatenate the name of the class (Column A) with the rest of the formula only if column B and C are empty.. because I don’t need the rest of D:D to contain that information.
Basically, how do I fill D:D with some info about the activity since there is no class to put in there!

ActivityEng ClassFR ClassFinal
Activity AClass AClass A
Activity BClass BClass B
Activity CClass DClass D
Activity DClass CClass C
Activity E
Activity F
Activity GClass BClass B
Activity H
Activity I
Activity JClass BClass B

Hope this makes sense!!

I thank you all amazing people!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Not sure if it is possible that in a row both column B & C can have data like row 12 below?
If so perhaps you want the column D formula.
If not then column E might be what you want?

If you have lots of columns instead of just B & C then something a bit different might be needed but that could depend on your response to the first paragraph above.

22 03 28.xlsm
ABCDE
1ActivityEng ClassFR ClassFinalFinal
2Activity AClass AClass AClass A
3Activity BClass BClass BClass B
4Activity CClass DClass DClass D
5Activity DClass CClass CClass C
6Activity EActivity EActivity E
7Activity FActivity FActivity F
8Activity GClass BClass BClass B
9Activity HActivity HActivity H
10Activity IActivity IActivity I
11Activity JClass BClass BClass B
12Activity KClass YClass ZClass Y, Class Z
Activities
Cell Formulas
RangeFormula
E2:E11E2=IF(B2&C2="",A2,B2&C2)
D2:D12D2=IF(B2&C2="",A2,TEXTJOIN(", ",1,B2:C2))
 
Upvote 0
Solution
@Peter_SSs You are priceless.

i have updated my profile and your options worked perfectly!

Many thanks.. i am now able to work on the report and push it to the audience!

thank you!
 
Upvote 0
You're welcome. Thanks for the follow-up. :)

.. and for updating your profile. (y)
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,539
Members
449,316
Latest member
sravya

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