+ Reply to Thread
Results 1 to 7 of 7

Converting an array to single digits

  1. #1
    Registered User
    Join Date
    07-07-2022
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    4

    Converting an array to single digits

    Hello!

    Ok, so I don't use excel a great deal but I do have some basic ideas.

    I'm creating a worksheet that converts an array into single digits, those digits are then converted to binary and placed into rows on a table. I then turn the columns into a hex number. I have got all of this worked out except for the very first part.

    Here are three examples of my input arrays, the elements to the left are left out.

    [0, 27, 9, 18]
    []
    [0, 10, 10, 31, 10, 31, 10, 10]

    I want to convert the above into 8 separate numbers into 8 separate cells, so for example;

    0 0 0 0 0 27 9 18


    I would greatly appreciate the help,
    Thank you !

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Converting an array to single digits

    Hi,

    So your input is a string contained within a single cell, e.g. "[0, 27, 9, 18]", i.e. including the square brackets?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    07-07-2022
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    4

    Re: Converting an array to single digits

    Hi, yes it is but I can omit the square brackets.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Converting an array to single digits

    Ok, thanks. Then without the square brackets would be:

    =IF($A1="","",INDEX(FILTERXML("<a><b>"&SUBSTITUTE(REPT("0,",7-LEN($A1)+LEN(SUBSTITUTE($A1,",","")))&$A1,",","</b><b>")&"</b></a>","//b"),COLUMNS($A1:A1)))

    and copied right.

    Note that FILTERXML only works in the desktop version of Excel, not online.

    Regards
    Last edited by XOR LX; 07-08-2022 at 12:56 AM.

  5. #5
    Registered User
    Join Date
    07-07-2022
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    4

    Re: Converting an array to single digits

    Wow!

    That's amazing, thank you,
    I made a mistake in my original statement,
    [0, 27, 9, 18]
    I would want the output to be 0 27 9 18 0 0 0 0

    I'd give it a shot myself but your formula is way over my current understanding of excel,

    I truly greatly appreciate your help!

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Converting an array to single digits

    Even easier!

    =IFERROR(FILTERXML("<a><b>"&SUBSTITUTE($A1,",","</b><b>")&"</b></a>","//b[position()="&COLUMNS($A1:A1)&"]"),"")

    Regards

  7. #7
    Registered User
    Join Date
    07-07-2022
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    4

    Re: Converting an array to single digits

    excellent !
    Thank you very much, this is exactly what I need

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Looking for a formula to count single digits vs. double digits?
    By mnlaw in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-29-2023, 02:20 PM
  2. want to sum digits (double or triple and single) within a single cell
    By Karshini in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-17-2021, 09:21 PM
  3. [SOLVED] How to subtract single cells with double digits into a single digit of a single cell.
    By greenfox74 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-11-2021, 02:05 AM
  4. [SOLVED] Convert date into single cells and reduce to single digits
    By khanaran in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 03-11-2021, 02:01 AM
  5. Converting an array of data into multiple arrays based on a single column values
    By bjcowen9000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2018, 01:13 PM
  6. Replies: 5
    Last Post: 03-10-2009, 11:02 PM
  7. [SOLVED] Converting an array of data into a single column
    By Raj in forum Excel General
    Replies: 0
    Last Post: 08-15-2006, 04:25 PM

Bookmarks

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