+ Reply to Thread
Results 1 to 4 of 4

Index Array Items

  1. #1
    Valued Forum Contributor saravnepali's Avatar
    Join Date
    01-14-2019
    Location
    Sydney Australia
    MS-Off Ver
    2010
    Posts
    447

    Index Array Items

    Hi,
    I am wondering if it is possible to have index items hardcoded on the formula.

    I need something like this, if possible

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to return A,B,C or D
    If you think someone helped you, click on the "* Add Reputation" as a way to say thank you.

    If your problem is solved, go to Thread Tools and select Mark This Thread Solved

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: Index Array Items

    With values of 1 to 4 in A1, you could put this formula in B1:

    =INDEX({"A","B","C","D"},A1)

    which will return the appropriate text value.

    Hope this helps.

    Pete

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: Index Array Items

    I usually start with something like this

    =CHAR(ROW($1:$5)+64)

    in the formula bar and hit the F9 function key to get this

    ={"A";"B";"C";"D";"E"}

    or =TRANSPOSE(CHAR(ROW($1:$5)+64))

    to get this

    ={"A","B","C","D","E"}

    Then do as Pete has done.
    Dave

  4. #4
    Valued Forum Contributor saravnepali's Avatar
    Join Date
    01-14-2019
    Location
    Sydney Australia
    MS-Off Ver
    2010
    Posts
    447

    Re: Index Array Items

    Thanks Pete.

    I tried to use random number in A1
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    By the way, is it possible to make it dynamic by replacing the number 4 which is the number of the elements with count function ,
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Something like

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


    by entering ONLY once the array elements
    Last edited by saravnepali; 12-15-2019 at 09:33 PM.

+ 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: 7
    Last Post: 03-12-2017, 03:20 PM
  2. [SOLVED] Index un-indexed items keeping original index numbers where they exist
    By BRISBANEBOB in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-25-2016, 03:55 AM
  3. Replies: 5
    Last Post: 12-02-2015, 05:23 AM
  4. [SOLVED] Storing selected items index from multiselect listbox into array
    By Pamela2411 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2015, 06:55 PM
  5. [SOLVED] Looping through dictionary items where items are an array
    By strud in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2014, 06:56 AM
  6. [SOLVED] Using Index and Match to search an array that has multiple items in each cell
    By tdlewis in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-20-2012, 08:45 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