Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Array reversal in excel

I got 8 bytes Hex values in a cell as below which is in little endian format
00 00 08 04 22 00 40 00

With text split I could get individual hex values in an array.
= TEXTSPLIT(A1, , " ")

00
00
08
04
22
00
40
00

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is there an excel formula that I can use to grab the values in reverse order from an array to do below?

00
40
00
22
04
08
00
00

I don’t want to use LEFT or MID or RIGHT extractors as I want to create generic formula that works on all data types.

>Solution :

Try:

enter image description here

Formula in A2:

=TEXTJOIN(" ",,SORTBY(TEXTSPLIT(A1,," "),ROW(1:8),-1))

I suppose you can make this more generic for any string you split on space:

 =LET(r,TEXTSPLIT(A1,," "),TEXTJOIN(" ",,SORTBY(r,SEQUENCE(ROWS(r)),-1)))

Note this is almost an exact copy of this question where you could also use the technique shown by @ScottCraner using INDEX().

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading