mbetsy

New Member
Joined
Aug 3, 2015
Messages
13
Happy New Year and thank you in advance.

I have 3 if statements which work individually but I don't do semi complex formula writing often enough to know how to do this properly.

If A1 is blank then concatenate this way, concatenate that way
If A1 is not blank and B1 is blank, then concatenate this way, concatenate that way
If A1 is not blank and B1 is not blank, then concatenate this way, concatenate that way

My concatenate formulas don't seem toe be the issue, true and false in a response would be understood.

Tks.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Something along the lines of
=IF(A1="","a1 is blank",IF(B1="", "a1 is not blank & b1 is blank","neither a1 nor b1 are blank"))
 
Upvote 0
Here are the 3 statements which work individually, which I would like to combine:

C1D1E1F1G1
=IF(ISBLANK(A2),IF(ISBLANK(B2),CONCATENATE(C1,G1),CONCATENATE("not what i want")))
A3=IF(NOT(ISBLANK(A3)),IF(ISBLANK(B3),CONCATENATE(C1,F1,G1),CONCATENATE("not what i want")))
A4B4=IF(NOT(ISBLANK(A4)),IF(ISBLANK(B4),CONCATENATE(C1,D1,E1,F1,G1),CONCATENATE("not what i want")))

<tbody>
</tbody>







Thank you.
 
Upvote 0
Can you show the expected outcome for each scenario?
 
Upvote 0
Thank you for sticking with me, Fluff.

C1D1E1F1G1
Desired Result: C1 G1
A3Desired Result: C1 F1 G1
A4B4Desired Result: C1 E1 F1 G1

<tbody>
</tbody>







Essentially, depending on the blank status of either A or B, pick up a different set of cells to concatenate. The three rules represent the 3 possible scenarios for my data.

/mbetsy
 
Upvote 0
Maybe,

In C2, copied down :

=CHOOSE(BIN2DEC(0+(A2<>"")&0+(B2<>""))+1,C$1&" "&G$1,"not what i want",C$1&" "&F$1&" "&G$1,C$1&" "&E$1&" "&F$1&" "&G$1)

Regards
Bosco
 
Upvote 0
Thank you, bosco. That does yield close to the desired result; adds an extra space between the cells. I have looked up the bin2dec function, but have had no occasion to use it. Can you explain the logic of the solution? Tks.
 
Upvote 0
Extract the BIN2DEC function part form the formula >>

>> BIN2DEC(0+(A2<>"")&0+(B2<>""))+1

This part >> 0+(A2<>"")&0+(B2<>"") generate 00, 01, 10 or 11

Then,

BIN2DEC(0+(A2<>"")&0+(B2<>""))+1 will give result 1, 2, 3 or 4 (being the Index number of the Choose function)

Regards
Bosco
 
Upvote 0
So the formula creates a value for an empty cell, then gives each permutation a unique value, and gives each permutation directions?

I have now successfully integrated this into my work, thank you very much.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

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