Saturday 22 June 2019

Why use CONCATENATE vs & in Excel?


I noticed that "EXEC MySproc," & "arg, " & "arg2" is essentially the same as =CONCATENATE("EXEC MySproc,", "arg,", "arg2") including the ability to use evaluations, functions etecetera. What is the usecase for using =CONCATENATE() vs &?



Answer



It's for people who like to type more. Probably the same audience that does things like =Sum((A1*A2)-A3) instead of =(A1*A2)-A3. (Yes, these people exist, and I don't know why they do that)


It also provides wonderful opportunities to create your very first User Defined Function with VBA to create something more useful than Concatenate().


Excel 2016 (with an Office 365 subscription) has a new function called TextJoin(), which takes a delimiter and a range as arguments and is a lot faster than typing out the ampersands and the delimiters as text strings. Now, THAT is useful.


enter image description here


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...