+ Reply to Thread
Results 1 to 15 of 15

Can anyone tell me the difference between using Choosecols and Index?

  1. #1
    Forum Contributor
    Join Date
    10-02-2023
    Location
    Singapore
    MS-Off Ver
    Microsoft 365
    Posts
    184

    Can anyone tell me the difference between using Choosecols and Index?

    Hi, not sure if this is a good question but then, when i am using match, sumif for array. Very often you need to use Choosecols or Index.
    However, I am nt sure when to use which. Normally, i trial and error. Thats y i hope some expert here can tell me the concept so that i understand rather than memorise.

    Anyone is able to tell me whats the difference between example choosecols(A:A,1) and Index(A:A,,1)? When to use which?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,711

    Re: Can anyone tell me the difference between using Choosecols and Index?

    CHOOSECOLS is shorter for multiple columns:

    =CHOOSECOLS(A:E,1,3,5)
    =HSTACK(INDEX(A:E,,1),INDEX(A:E,,3),INDEX(A:E,,5))
    Last edited by AliGW; 12-29-2023 at 03:23 AM. Reason: Typo fixed.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    10-02-2023
    Location
    Singapore
    MS-Off Ver
    Microsoft 365
    Posts
    184

    Re: Can anyone tell me the difference between using Choosecols and Index?

    Oic, thanks. So a good thing about choosecols is can multiple choose columns.
    But then duno y, sometimes when i use either one of them, then the result return error, but when i change it to the other, it become ok.
    hmm... maybe i type wrongly...

    Anyway, so these 2 function, can be use interchangeably? Regardless of sumif, xmatch, or choosecols="" or index="" all is ok ?

    Then when should we use Index instead of Choosecols?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,711

    Re: Can anyone tell me the difference between using Choosecols and Index?

    It's trial and error - sometimes INDEX works better, sometimes CHOOSECOLS does. Having more than one way to skin a cat is always useful. There is no definitive answer to your question.

  5. #5
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Can anyone tell me the difference between using Choosecols and Index?

    If you always want to select 1 cell, 1 row or 1 column with the formula (and you know the position in the range) the easiest way is to use INDEX.

  6. #6
    Forum Contributor
    Join Date
    10-02-2023
    Location
    Singapore
    MS-Off Ver
    Microsoft 365
    Posts
    184

    Re: Can anyone tell me the difference between using Choosecols and Index?

    Aligw, thanks for your suggestion.

    HansDouwe, oh ya. I get what you mean. Index has a Row and Column while Choosecols only has Column. Thanks for the enlightens.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,711

    Re: Can anyone tell me the difference between using Choosecols and Index?

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,300

    Re: Can anyone tell me the difference between using Choosecols and Index?

    CHOOSECOLS always returns an array, not a reference to a range, so it won't work with a function like SUMIF or COUNTIF.
    Anyone who confuses correlation and causation ends up dead.

  9. #9
    Forum Contributor
    Join Date
    10-02-2023
    Location
    Singapore
    MS-Off Ver
    Microsoft 365
    Posts
    184

    Re: Can anyone tell me the difference between using Choosecols and Index?

    Hi Rorya, thanks for your reply.

    but errr.... whats the difference between array and range? Then index is return array or range?
    Last edited by AliGW; 12-29-2023 at 07:28 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,300

    Re: Can anyone tell me the difference between using Choosecols and Index?

    An array is a matrix of values in memory. INDEX may or may not return a range, depending on how it's used. Generally speaking, when applied to a range, it will return a reference to a range. You could for example use:

    =SUMIF(INDEX($A:$C,0,1),"a",INDEX(A:C,0,3))

    but you can't use:

    =SUMIF(CHOOSECOLS(A:C,1),"a",CHOOSECOLS(A:C,3))

  11. #11
    Forum Contributor
    Join Date
    10-02-2023
    Location
    Singapore
    MS-Off Ver
    Microsoft 365
    Posts
    184

    Re: Can anyone tell me the difference between using Choosecols and Index?

    Wow. Thats very very good explaination. Does it mean Array might be either Array or Range but Range is not Array?

    From what you say, seems like using Index will work 99% of the time.
    Last edited by AliGW; 12-29-2023 at 11:13 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead.

  12. #12
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,391

    Re: Can anyone tell me the difference between using Choosecols and Index?

    Still wondering when they are going to make this work though

    =SUMIF(CHOOSECOLS(A:C,1),"a",CHOOSECOLS(A:C,3))

  13. #13
    Forum Contributor
    Join Date
    10-02-2023
    Location
    Singapore
    MS-Off Ver
    Microsoft 365
    Posts
    184

    Re: Can anyone tell me the difference between using Choosecols and Index?

    JEC, agreed. Maybe the next version of Excel, we can use Choosecols for sumif.
    But from what Rorya mention, Choosecols return Array while Index return either Range/Array.
    BUt i have no idea why they emphasis so much on the difference between range and array.

  14. #14
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Can anyone tell me the difference between using Choosecols and Index?

    In Power Query you have List and Table, they are different.
    Range = A1:B3
    Array= {1,2,3\4,5,6}
    Last edited by DJunqueira; 12-29-2023 at 02:48 PM.

  15. #15
    Forum Contributor
    Join Date
    10-02-2023
    Location
    Singapore
    MS-Off Ver
    Microsoft 365
    Posts
    184

    Re: Can anyone tell me the difference between using Choosecols and Index?

    Hi, sorry for the late reply.

    I think i get what you mean. Thanks for the help.

    Happy New Year!

+ 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. Sorting Results from VSTACK, FILTER with CHOOSECOLS
    By drvs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2023, 03:51 PM
  2. Take,ChooseCols,Sort Function Not Showing Output In A Particular Cell
    By quentinlemmer in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 07-07-2023, 08:52 AM
  3. CHOOSECOLS and add a blank column
    By elischwa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-17-2023, 02:26 AM
  4. difference between index match and just stating reference?
    By Bobgiant in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2022, 04:15 PM
  5. Difference between two tables using index match?
    By TheFab in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-01-2015, 09:38 AM
  6. What is the difference between Vlookup and Index
    By amartino44 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-28-2013, 12:42 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