Forum Discussion
How to convert more colums into a single one separated by ";"
I take the solution a bit further than Patrick2788
Rather than creating a fill-down formula with relative referencing, I aim to create a single function that returns the entire list. Naming your data, 'dataArray', the processing may be done row by row using
= BYROW(dataArray, Joinλ)where Joinλ is a slightly more restrictive Lambda version of TEXTJOIN
= LAMBDA(x, TEXTJOIN(";", , x))I would upload a picture but, apparently I can no longer be allowed to upload pictures.
- SergeiBaklanSep 10, 2023Diamond Contributor
To play with Python for Excel
import numpy df = xl("dataArray", headers = False ) rows = numpy.matrix(df).tolist() list(map(lambda x : '; '.join(x), rows) )Result is the same.
- PeterBartholomew1Sep 10, 2023Silver Contributor
I have still to come to terms with this (I need to put some time aside). Does the access to Python libraries augment the world of spreadsheet formulas or replace it? For a hard-core Python programmer, I guess it is the latter, but do they need Excel and the worksheet environment.
I can see some places where rolling one's own formulas is verging on being too difficult (extracting eigenvalues for example) and a well-written library routine would inspire greater confidence. At the moment, though, I have so much more from the Excel formula language, particularly as it includes Lambda functions, than I might ever have dreamt of having to hand.
- SergeiBaklanSep 11, 2023Diamond Contributor
I think Python on Excel will have quite narrow niche. Libraries is definitely a plus. The rest - I'm not sure. Depends also on pricing model. Python for Power BI was introduced at least an year ago, but I don't see it becomes very popular in that environment.
But why don't to play with new tool.
- SergeiBaklanSep 10, 2023Diamond Contributor
- PeterBartholomew1Sep 10, 2023Silver Contributor
Thank you. It does help convey the message!