+ Reply to Thread
Results 1 to 10 of 10

What the function should be used to sort 2 conditions?

  1. #1
    Registered User
    Join Date
    01-16-2018
    Location
    taiwan
    MS-Off Ver
    2010
    Posts
    19

    What the function should be used to sort 2 conditions?

    Hi,

    I want to calculate the average of the recent 3 marks of tom, arrange by the certain date as well, so there are 2 conditions to sort together.
    The input date is 5/12/2017, so the recent 3 would before this date, how should I use the function?

    Thanks very much

    1.png 2.png

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

    Re: What the function should be used to sort 2 conditions?

    what is your expected result for the above and explain why (how you arrived it).
    Samba

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

  3. #3
    Registered User
    Join Date
    01-16-2018
    Location
    taiwan
    MS-Off Ver
    2010
    Posts
    19

    Re: What the function should be used to sort 2 conditions?

    Dear Siva,
    I want the recent 3 average marks "library!c11:c13" to be calculated in "result!C2" by sorting any date(say 5/12/2017) and name I input in the "result" workbook.

    regards,
    joe

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

    Re: What the function should be used to sort 2 conditions?

    but the recent 3 days for 5/12/2017 would be c3:c5
    the recent days are 29/11/2017,08/11/2017 and 11/10/17, how it were 27/11/2016,02/11/2016 and 16/10/2016

  5. #5
    Registered User
    Join Date
    01-16-2018
    Location
    taiwan
    MS-Off Ver
    2010
    Posts
    19

    Re: What the function should be used to sort 2 conditions?

    sorry, my careless mistakes
    you are right should be c3:c5, anyway my main concern is how to sort by 2 conditions (date and name) where I input in the "result" workbook, and to calcuate its recent 3 average marks before that date.

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

    Re: What the function should be used to sort 2 conditions?

    please attach a sample workbook instead of image

  7. #7
    Registered User
    Join Date
    01-16-2018
    Location
    taiwan
    MS-Off Ver
    2010
    Posts
    19

    Re: What the function should be used to sort 2 conditions?

    please see the attachment
    Attached Files Attached Files

  8. #8
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: What the function should be used to sort 2 conditions?

    Try

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


    ...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.
    Last edited by shukla.ankur281190; 01-17-2018 at 01:37 AM. Reason: Locked the ranges
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

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

    Re: What the function should be used to sort 2 conditions?

    try below formula
    Please Login or Register  to view this content.
    Note:- It will not give correct results if you have duplicate dates for the same name (Means having 2 marks rows for the same date and for the same person)

  10. #10
    Registered User
    Join Date
    01-16-2018
    Location
    taiwan
    MS-Off Ver
    2010
    Posts
    19

    Re: What the function should be used to sort 2 conditions?

    It works!
    thanks very very much, you are helpful

+ 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] LOOKUP formula with 3 conditions and sort/filter function
    By JPSIMMON in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-12-2018, 07:25 PM
  2. [SOLVED] Sort my Excel by ROWs as with conditions
    By vivian4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2017, 09:37 AM
  3. [SOLVED] Sort or Rank with multiple conditions?
    By DAWilson in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-08-2015, 01:02 PM
  4. Best way to Sort Data with multiple conditions
    By timmiller420 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-08-2013, 08:48 AM
  5. [SOLVED] How to add a record automatically sort by set conditions
    By zhouyiqing in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 10:29 PM
  6. Sort data with conditions on another worksheet
    By rohit43 in forum Excel General
    Replies: 8
    Last Post: 01-23-2013, 02:46 PM
  7. How do I sort data with multiple conditions?
    By CorinDarksoul in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-25-2006, 08:50 PM

Tags for this Thread

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