+ Reply to Thread
Results 1 to 9 of 9

Add Value To Array

  1. #1
    Registered User
    Join Date
    01-12-2022
    Location
    Brno, Czech Republic
    MS-Off Ver
    365
    Posts
    44

    Add Value To Array

    Hi,

    Is there a way how to add a value(s) to an array? See the attached example spreasheet.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Add Value To Array

    So you want the value 31/12/2022 to appear twice in your UNIQUE list????
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Add Value To Array

    On the assumption that duplicating that date was a mistake on your part...


    =UNIQUE(SORT(FILTERXML("<A><B>"&SUBSTITUTE(TEXTJOIN(",",,Date,D2),",","</B><B>")&"</B></A>","//B")))
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-12-2022
    Location
    Brno, Czech Republic
    MS-Off Ver
    365
    Posts
    44

    Re: Add Value To Array

    Hi Glenn,

    That was intentional. But I did make a mistake C8 should have been 13.02.2022 and the result array should have ended with twice 31.12.2022. So let me clarify: I need the array of sorted uniques dates from old to new and the newest one is to appear twice at the end.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Add Value To Array

    Hi. If this isn't it... please upload a new sample showing EXACTLY what's required....


    =SORT(FILTERXML("<A><B>"&SUBSTITUTE(TEXTJOIN(",",,UNIQUE(SORT(Date)),D2),",","</B><B>")&"</B></A>","//B"))
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Add Value To Array

    Or maybe
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-12-2022
    Location
    Brno, Czech Republic
    MS-Off Ver
    365
    Posts
    44

    Re: Add Value To Array

    Glenn,
    the reason I need two rightmost cells with same date is that I need to have prepare a spreadsheet for Step chart which is not native Excel chart. Please check my thread "Price development" where I break down the issue into more deta. This thread solves one of sub tasks mentioned in the Price Development thread.
    As for your solution, it works the tway it only duplicated th highest value if it matches the value in the yellow external cell. If you add older date, no dupication happens.

    Anyway, Fluff13 finds a correct solution. It simply takes the highest value from the origical array and duplicates it.

    Many Thanks

  8. #8
    Registered User
    Join Date
    01-12-2022
    Location
    Brno, Czech Republic
    MS-Off Ver
    365
    Posts
    44

    Re: Add Value To Array

    Quote Originally Posted by Fluff13 View Post
    Or maybe
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Fluff13,

    You have found a splution! Thanks a lot!!!
    Last edited by tomas777; 01-16-2022 at 07:45 AM.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Add Value To Array

    Glad to help & thanks for the feedback.

+ 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. Replies: 5
    Last Post: 02-22-2018, 01:47 AM
  2. Replies: 1
    Last Post: 01-04-2018, 01:07 PM
  3. [SOLVED] Array formulae with different sized array, e.g. array-if() or somproduct-if()?
    By hlhans in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-09-2016, 03:59 PM
  4. [SOLVED] Populate one array from another array and print new array as a range
    By Kaden265 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2014, 07:52 AM
  5. [SOLVED] Quick Array question - Copy array to another array then resize?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-02-2013, 01:17 AM
  6. [SOLVED] Populate Listbox with all rows of a dynamic array where elements of a single array match.
    By Tayque_J_Holmes in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-07-2012, 04:54 AM

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