+ Reply to Thread
Results 1 to 2 of 2

How can I add another requirement to this query?

  1. #1
    Registered User
    Join Date
    12-06-2020
    Location
    USA
    MS-Off Ver
    2007
    Posts
    2

    How can I add another requirement to this query?

    TLDR: Formula and summary of question/problem at the bottom if you want to skip ahead.

    I have a sheet where names are in column A and B. There are numerical values in columns C, D, E, and F.

    Newest values are at the bottom (oldest at the top).

    What I want to do is for the most recent 10 entries of a name in columns A & B, I want to average C (when the name is in column A) and D (when the value is in column D).

    However, the caveat is I also want to get the column C value **ONLY** when column F is a certain thing (ie when "greater than 100"). And similarly, I want column D ONLY when the corresponding column E value is the same (>100).

    Basically I want value of C2 when A2 is the name of the person and when F2 is greater than ___.
    And with that same query I want value of D when B2 is the name and when E2 is greater than ___.
    Not a typo - it's A/C/F and B/D/E.

    ALSO, I DO NOT want the last 10 times the condition of BOTH A/F or B/E are met. I want the last 10 instances of the name, and if let's say I look for the most recent 10, and there are only one or two times where the E/F column requirements are met, then that's all I'd want returned.

    My formula right now is this.

    Please Login or Register  to view this content.
    In this case, A2 references the name I am using in my query, as a heads up.


    ^ This gets me the combined average of column C (when A2 is in column A of the Data sheet) and column D (when A2 is in column B of the Data sheet).

    Now what I need to do is add the second part of the query...how do I get this Average query into an Averageifs one, where it also only returns the value if column F is greater than ___ if A2 is in column A and only returns the value if column E is greater than ___ if A2 is in column B.

  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 2406
    Posts
    44,397

    Re: How can I add another requirement to this query?

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet.

    Secondly, is this an Excel question or a Google sheets question. If the latter, I'll move the thread to the correct sub-forum.
    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

+ 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. Requirement in VBA code
    By Rajesh_Tup in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-16-2018, 09:24 AM
  2. Requirement in Vba code
    By Rajesh_Tup in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2018, 05:24 PM
  3. query w/ minimum requirement in google sheets
    By alansoftpublisher in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 12-14-2014, 04:59 AM
  4. STAFFING REQUIREMENT with TAT
    By coolzero in forum Excel General
    Replies: 2
    Last Post: 12-13-2012, 04:01 PM
  5. Forcing Dim Requirement
    By Phil_V in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2006, 03:45 PM
  6. [SOLVED] if until requirement met
    By stefan via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-28-2005, 03:05 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