concatenate with if criteria

nikhil0311

Board Regular
Joined
May 3, 2013
Messages
200
Office Version
  1. 2013
Platform
  1. Windows
AUNZ:- In discussion with PB​
CN:-
HK:-
IN:- Deal closed​
ID:-
JP:-
KR:-
MY:- No action required​
AUNZ:- In discussion with PB

IN:- Deal closed

MY:- No action required​
A1:AH is the data​
in column A6 I want the final output​
If in range A1:H1 description of country is available then only it should be shown in cell A6 else no. Here in the above example we have description available for AUSNS; IN; MY only so these should be shown as final output in cell A6. Also countries output in cell A6 should not come in the same line. it should start from new line.​
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
This will do it, remember to set wrap text on A6 or the line feed will not work.

=IF(RIGHT(A1)="-","",A1&CHAR(10))&IF(RIGHT(B1)="-","",B1&CHAR(10))&IF(RIGHT(C1)="-","",C1&CHAR(10))&IF(RIGHT(D1)="-","",D1&CHAR(10))&IF(RIGHT(E1)="-","",E1&CHAR(10))&IF(RIGHT(F1)="-","",F1&CHAR(10))&IF(RIGHT(G1)="-","",G1&CHAR(10))&IF(RIGHT(H1)="-","",H1&CHAR(10))
 
Upvote 0
This will do it, remember to set wrap text on A6 or the line feed will not work.

=IF(RIGHT(A1)="-","",A1&CHAR(10))&IF(RIGHT(B1)="-","",B1&CHAR(10))&IF(RIGHT(C1)="-","",C1&CHAR(10))&IF(RIGHT(D1)="-","",D1&CHAR(10))&IF(RIGHT(E1)="-","",E1&CHAR(10))&IF(RIGHT(F1)="-","",F1&CHAR(10))&IF(RIGHT(G1)="-","",G1&CHAR(10))&IF(RIGHT(H1)="-","",H1&CHAR(10))

Hi Jason. Thanks a lot for your help!
i am getting the below output as per your formula. I only want those countries where description is available. (only AUSNZ , IN & MY should come as rest of the countries don't have any description available
)
AUNZ:- In discussion with PB
CN:-
HK:-
IN:- Deal closed
ID:-
JP:-
KR:-
MY:- No action required​
 
Upvote 0
Hi Jason. Thanks a lot for your help!
i am getting the below output as per your formula. I only want those countries where description is available. (only AUSNZ , IN & MY should come as rest of the countries don't have any description available
)
AUNZ:- In discussion with PB
CN:-
HK:-
IN:- Deal closed
ID:-
JP:-
KR:-
MY:- No action required​
Hey Jason, its working absolutely fine. There were redundant spaces in my data that is why it was not working correctly. I have removed the spaces and its working like a charm.

Again thanks a lot for your help :)
 
Upvote 0

Forum statistics

Threads
1,223,981
Messages
6,175,768
Members
452,668
Latest member
mrider123

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