Combine results of multiple IF statements into 1 cell

Gavin Harrison

New Member
Joined
May 2, 2017
Messages
34
Hi All.

Im looking to combine the results of 3 if statements into one cell as well as add static data from another cell at the end.

I have the below formula so far:

=IFERROR(IF(NOT(A1="HSK"),"", B1&" / "&IF(NOT(C1="HSK"),"",D1&" / "&IF(NOT(H1="HSK"),"", F1&" / ")))&G1,"")

The data in all the cells will be text.

In the example below with the working formula entered in H1, i would like the below result.

ABCDEFGH
1FOHtest 1HSKtest 2HSKtest 3test 4test 2 / test 3 / test 4

The formula that i have posted above, does kind of work, but sometimes misses out some of the responses.

Any help greatly appreciated.

Thanks :)
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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’)
 
Upvote 0
It would also help if you included a few more sample rows and their expected results to show any variation that you might get with your data, preferably with XL2BB
 
Upvote 0
If you are using Office 2019 or above this should work:
Excel Formula:
=TEXTJOIN(" / ",,IF((TRIM($A$1:$F$1)<>"FOH")*(TRIM($A$1:$F$1)<>"HSK"),$A$1:$F$1,""))
This is an array formula. You must press Ctrl+Shift+Enter together after pasting unless you are using Office 365.

Dear @Peter_SSs,
I was not able to make wildcards work around FOH or HSK. That's why I choose to trim ranges. Why haven't mywild cards worked?
 
Upvote 0
Another option if you have 2019 or newer
Fluff.xlsm
ABCDEFGH
1FOHtest 1HSKtest 2HSKtest 3test 4test 2 / test 3 / test 4
2HSKtest 2HSKtest 3FOHtest 3test 4test 2 / test 3 / test 4
3FOHtest 2FOHtest 3FOHtest 3test 4test 4
4
View
Cell Formulas
RangeFormula
H1:H3H1=TEXTJOIN(" / ",,IF(A1:E1="HSK",B1:F1,""),G1)
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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