Link to home
Start Free TrialLog in
Avatar of Anthony Mellor
Anthony MellorFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Dynamic Array (DA) Make the 4th item output as a value not text?

LET(RowCount,ROUNDDOWN((LEN(A1)-LEN(SUBSTITUTE(A1,",","")))/4+1,0),TokenIndex,SEQUENCE(RowCount,4,1),Start,FIND("|",SUBSTITUTE(","&A1,",","|",TokenIndex)),Length,FIND("|",SUBSTITUTE(A1&",,,,",",","|",TokenIndex))-Start,IFERROR(MID(A1,Start,Length),""))

Open in new window

The output looks like this (headings are manual) Col D is text and reads as zero:

User generated image

The active formula is this bit at the end: IFERROR(MID(A1,Start,Length),"")
but doing this: Value(IFERROR(MID(A1,Start,Length),""))
turns the preceding three results in to blanks, like wise various Text() formats.
I also tried an IF to only do the Value thing on the 4th item, but no joy, though that may be a way I have missed.

This is the csv data for cell A1: 
Customer2,SLC,01PG,-0021600.00,Customer2,01CQ,01PG,00021600.00,Customer2,SLC,02PG,-0021600.00,Customer2,SLC,03PG,-0024840.00,Customer2,02CQ,02PG,00021600.00,Customer2,02CQ,03PG,00024840.00,ABCD ltd,PLC,01AB,00002400.00,ABCD ltd,03CQ,01AB,-0002000.00,ABCD ltd,03CQ,01AB,-0000400.00,ABCD ltd,PLC,02AB,00002400.00,ABCD ltd,04CQ,02AB,-0002400.00,ABCD ltd,PLC,03AB,00002760.00,ABCD ltd,05CQ,03AB,-0002760.00,Customer2,SLC,04PG,-0021600.00,ABCD ltd,PLC,04AB,00002400.00

or use the file attached:
DA-ValueEE.xlsx

Anthony
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anthony Mellor

ASKER

I am curious, do you both have a view on which is in some way the better solution? Edit both give identical results.
I remain humbled as ever.
Anthony
If the other columns must not be converted then only Norie's solution can do it.

If it does not matter then mine is better.
The first three columns are required text, the 4th being the numeric value.

If it does not matter then mine is better.


Why?
Looks like
Norie's is specific to the 4th value
Yours is robust against wider errors?
Must admit I'm not sure what you mean about 
"If the other columns must not be converted"
Do you mean the first three columns must not be converted to values? That is true, but yours works too.

Regret I am not exactly qualified to adjudicate... hence my question.

Anthony


Maybe it would be a phone number with leading zeros. My formula would chop of the leading zeros.
ok thanks saqib, that will help Me analyse both to see what I learn

Anthoy