# Combining Two Functions into One Function?

1. ## Combining Two Functions into One Function?

Last week AC-XL shared this function....

Cell S2 =SUBSTITUTE(TRIM(K2&" "&L2&" "&M2&" "&N2&" "&O2&" "&P2&" "&Q2&" "&R2)," ","; ")

…for combining fields without getting extra spaces or semi-colons. It works great. Now I’m wondering if it is possible to add a refinement that would make things even easier.

Before using AC-XL’s function above, I manually insert columns (K thru S) and then manually add this function......

Cell K2 =IF(C2="x",C\$1,"")
Cell L2 = =IF(D2="x",D\$1,"")
etc.

….which basically copies the Column label into the field if it has an “x” in it. Only then can I use AC-XL’s function.

Any way to combine this all in one function?

2. ## Re: Combining Two Functions into One Function?

SpeakingPeace,

To combine them both, it would look like this:
``Please Login or Register  to view this content.``

An alternative, however, is to use a UDF, like my ConcatAll UDF which can be found here:
http://www.excelforum.com/tips-and-t...geravatar.html

Use the code in post 8 of that thread for the UDF itself
Use the instructions in the first post for how to implement it

Then you would use this array formula in cell S2 and copied down. Note that array formulas must be entered with Ctrl+Shift+Enter and not just Enter:
``Please Login or Register  to view this content.``

3. ## Re: Combining Two Functions into One Function?

Tigeravatar,

Thank you! It works like a charm and is a bit help.

4. ## Re: Combining Two Functions into One Function?

You're very welcome

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1