+ Reply to Thread
Results 1 to 8 of 8

How to create a array formula to retrieve data?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    How to create a array formula to retrieve data?

    Hi friends,
    I want to find out the top students in the class in a subject. I’m not getting correct output on the summary sheet.

    The data is on ‘Data’ sheet and I want the top students on ‘Summary’ sheet.

    Simply I want to retrieve the data from ‘Data’ sheet to ‘Summary’ sheet.

    Any help will be appreciated.

    Thanking you.
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: How to create a array formula to retrieve data?

    Try this ARRAY formula in I6, copied down and across...
    =INDEX(Data!J$4:J$48,MATCH($H6&MAX(IF(Data!$H$4:$H$48=$H6,Data!$M$4:$M$48,0)),Data!$H$4:$H$48&Data!$M$4:$M$48,0))
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to create a array formula to retrieve data?

    Hi Ford,
    Thank you for solution. However it's not working properly. I want to match the subject on summary sheet '$m$4'. If there is 'Marathi' subject in m4 then all the top students for Marathi subject should be retrieve from 'Data' sheet on 'Summary' sheet automatically. and not the students for other subjects which didn't match cell 'm4' on 'Summary' sheet.

    Please do the amendment in the array formula to achieve the target.

    Thank you.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: How to create a array formula to retrieve data?

    sorry, thought you wanted it based on highest score overall.

    Try this instead...
    =INDEX(Data!J$4:J$48,MATCH($M$4&LARGE(IF(Data!$I$4:$I$48=$M$4,Data!$M$4:$M$48,0),$H6),Data!$I$4:$I$48&Data!$M$4:$M$48,0))
    ARRAY entered

    Not, this does not work for duplicate scores

    I can fix this if you are OK using a helper column?

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: How to create a array formula to retrieve data?

    I6=INDEX(Data!J$4:J$48,MATCH(LARGE(INDEX(((Data!$M$4:$M$48)+1/(ROW(Data!$M$4:$M$48)*10^10))*(Data!$I$4:$I$48=$M$4),0),$H6),INDEX(((Data!$M$4:$M$48)+1/(ROW(Data!$M$4:$M$48)*10^10))*(Data!$I$4:$I$48=$M$4),0),0))
    Try this and copy across
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to create a array formula to retrieve data?

    Hi Ford,
    No, I don’t want to add helping column because there is no place for it. I have another data there which I don’t want to move to avoide any programming error.

    Hi Siva,
    Good! It's working absolutely fine as per my requirement but one little amendment is require to make it fullproof.

    See subject 'Hindi general and Hindi Special' If I enter 'Hindi' then it gives output of 'Marathi'.

    Sorry for not mentioning it before that the 'Hindi general' and 'Hindi special' are count as one subject while ranking. See ranking formula for reference.

    Amendment require:

    If I enter a subject 'Hindi' instead of 'Hindi general' and 'Hindi special' then it should be count as one subject group.

    Output require for Hindi:

    1 Hindi general B2 67/100 Std. 5 B 0.67 1
    2 Hindi general D2 61/100 Std. 5 D 0.61 2
    3 Hindi special C2 57/100 Std. 5 C 0.57 3
    4 Hindi general A2 55/100 Std. 5 A 0.55 4
    5 Hindi special E2 33/100 Std. 5 E 0.33 5


    Sorry for trouble.

    Thank you.
    Attached Files Attached Files

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: How to create a array formula to retrieve data?

    see the attached file
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to create a array formula to retrieve data?

    Hi Shiva,
    First of all I apologize for the delayed reply for the excellent creation. I was out of station so I couldn't reply you quickly.

    Excellent! What a magic of array formula. It's working absolutely fine as per my requirement. I didn't understand the magic of it but it's perfect.

    I appreciate you for the magic array formula creation to achieve the target.

    Thank you.

+ 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] Retrieve Data From Cell Based in Array Based on LARGE Function
    By justarandomguy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-13-2014, 02:31 AM
  2. Replies: 6
    Last Post: 10-21-2013, 05:35 AM
  3. How to write data into an array and retrieve data from array?
    By nigel_12 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2013, 07:06 AM
  4. [SOLVED] Retrieve different delivery dates for the same material code - ARRAY FORMULA
    By carlosmaldonado in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-17-2012, 08:37 AM
  5. [SOLVED] Retrieve different delivery dates for the same material code - ARRAY FORMULA
    By carlosmaldonado in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-17-2012, 06:08 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