+ Reply to Thread
Results 1 to 18 of 18

Formula to copy rows based on on three different criteria

  1. #1
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    447

    Formula to copy rows based on on three different criteria

    Hi Folks,

    I've got a formula that identifies two statuses "Overdue" & "Not Started":
    Please Login or Register  to view this content.
    This produces a count of all those rows that where the status is "Overdue" then follows on by counting those rows where the status is "Not Started"

    I'd really like to add a third state of "In Progress" to this formula. Ideally, this would start the "In Progress" immediately after the "Not Started" count.

    Can anyone help? (I can produce a Example sheet if necessary, I'll just need to "sanitise" it a bit.

    Thanks
    Attached Files Attached Files
    Last edited by AliGW; 02-12-2022 at 08:45 AM. Reason: Title updated.

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

    Re: Additional criteria to formula

    Yes, please - use the one you used in the earlier thread, which shuld save you time. Make sure you give some examples of the new requirement manually mocked up.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,593

    Re: Additional criteria to formula

    Just a thought - do you mean this?

    =IF(G3="Overdue",COUNTIF(G$3:G3,G3),IF(G3="Not Started",COUNTIF(G$3:G3,G3)+COUNTIF(G:G,"Overdue"),"In Progress"))

  4. #4
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    447

    Re: Additional criteria to formula

    I've uploaded the sample workbook. (Serves me right for hoping I could get away with it )


    As it stands, Cell H4 in the "NonCompletion Findings" Tab would be 16 and then would be added to the "NonCompletion List" Tab after the "Not Started" list.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,593

    Re: Additional criteria to formula

    The workbook shows examples of formulae that already return "In Progress".

    There is far too much data there for a useful sample file - it needs to be smaller so that we can find our way around and test our solutions easily.

    So, where are we looking EXACTLY? Cell reference, please. What is WRONG with the current output, and what do you want to see INSTEAD?

    There are NO helpful annotations in the sample sheet. You should not assume that we have followed ANY of your previous threads ...

  6. #6
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    447

    Re: Additional criteria to formula

    Okay, I've reduced the sample size and revamped the Sample Sheet and Added in the "Ideal" that I'd like to see in the Key Tabs. (The Tab I've called Training Report (Source Data) is literally just where the other sheets data is originated from).

    What is wrong with the current output is that in the "NonCompletion List" Tab, It will only list the Overdue and Not Started Statuses. I'd like it to also list the "In Progress" status (after the "Not Started").

    The goal is to be able to produce a report that can be used to identify who hasn't completed mandatory training and what their completion status is.

    I do appreciate your help and hope I've made it a bit clearer.

    Thanks

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

    Re: Additional criteria to formula

    I am most likely being extremely thick today, but I really don't understand your numbering system. I will step aside - someone who does can assist. Sorry!

  8. #8
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    447
    No worries, thanks for looking at it.
    Last edited by AliGW; 02-11-2022 at 10:07 AM. Reason: PLEASE don't quote unnecessarily!

  9. #9
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    447

    Re: Additional criteria to formula

    Basically, it counts and numbers the 'Overdue' first, then it counts and numbers the 'Not Started'.

    This bit works fine 🙂

    I'm trying to get it to follow on so it then counts and numbers the 'In progress' ones as well.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,799

    Re: Additional criteria to formula

    Like Ali, I am confused by your logic: the list in "NonCompletion List" Tab only works if the data is sorted by Criteria..

    Why not 3 simple counts based on the 3 criteria which you can summate in any combination you desire.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,593

    Re: Additional criteria to formula

    Thanks for stepping in, John, and for making me feel a lot less 'thick'.

  12. #12
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    447

    Additional criteria to formula

    Hi Folks,

    As I did such a shocking job of explaining myself yesterday (Genuinely, on reflection, it really was THAT BAD!) , I thought I'd have another go and, hopefully, be a bit clearer in my request.

    In the Sample Workbook attached, data is entered in to the Source Data tab. There are 5 states in the Category Column (H:H) which are: Very Low, Low, Moderate, High and Critical.

    I'm looking for a formula that will copy rows on to a different sheet (Destination Sheet?) where the category is either Critical, High or Moderate. I'd like the output to be in that order

    Here's a preview of the Source Sheet
    Attachment 767831

    and here's a preview of what I'm hoping to achieve:
    Attachment 767832

    While I appreciate I could achieve this using VBA, unfortunately, where I'm planning to store it doesn't allow for *.xlsm files, so I'm having to rely on formula.

    Any help would be appreciated and thank you in advance

    P.S. I've put a little "Briefing" tab in the workbook in the hope it provdes some degree of clarity.
    Attached Images Attached Images
    Attached Files Attached Files

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,593

    Re: Additional criteria to formula

    New information copied here from the duplicate thread (now closed). Please continue HERE, as per the forum rules. Thank you.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,799

    Re: Additional criteria to formula

    Try

    in I4 of "Source Data"0Helper column)

    =COUNTIF($H$4:$H4,$H4)+LOOKUP(H4,{"Critical","High","Low","Moderate","Very Low"},{100,1000,1000000,10000,1000000})

    Copy down

    In A4 of "Desired Outcome")

    =IF(SMALL('Source Data'!$I$4:$I$1000,ROWS($1:1))>100000,"",INDEX('Source Data'!A$4:A$1000,MATCH(SMALL('Source Data'!$I$4:$I$1000,ROWS($1:1)),'Source Data'!$I$4:$I$1000,0)))

    See "Result"
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    447

    Re: Formula to copy rows based on on three different criteria

    John,

    That is absolutely spot on! - Thank you so much. (Added to Rep)

    Just for my education, can I ask what the significance of the curly brackets in the formula are?

    Please Login or Register  to view this content.
    Is it something to do with 'hard coding' an array as opposed to specifying it from another source?

    Thanks

    Terry

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,593

    Re: Formula to copy rows based on on three different criteria

    LOOKUP requires a lookup array (in alphabetical order):

    {"Critical","High","Low","Moderate","Very Low"}

    and a results array:

    {100,1000,1000000,10000,1000000}

    The curly brackets show Excel where these arrays start and finish in the formula:

    LOOKUP(H4,{"Critical","High","Low","Moderate","Very Low"},{100,1000,1000000,10000,1000000})

    If that takes care of your original question, please select 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 those who have helped you by clicking the small star icon 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 all those who offered help.

  17. #17
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    447

    Re: Formula to copy rows based on on three different criteria

    Thanks for the explanation AliGW

    Rep already given to John and will mark it as [SOLVED]

    Every day's a school day (and thanks to other people's efforts, I'm going to look good at work )

  18. #18
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Re: Formula to copy rows based on on three different criteria

    MagicMan,

    1. Match Mutliple Categories:

    Source Data worksheet on attached uses a Helper Column in Col I with this in I2 copied down:

    =IF(OR('Source Data'!$H2="Critical",'Source Data'!$H2="High",'Source Data'!$H2="Moderate"),1,0)

    So anything with a "1" matches your requirement.

    On OUTCOME sheet formula in A2 extracts all the matching records across Cols A - H

    =FILTER('Source Data'!$A$2:$H$24,'Source Data'!$I$2:$I$24=1,"No matches").

    Note it does not pull the Helper col I across, just the data in Cols A - H.

    2. Match selected Location:

    Created list of unique locations in Col U, and Data Validated J2 with it.

    Select Location from the DropList, and this formula in L2 brings over all the matching records into Cols L - S automatically.

    =FILTER('Source Data'!$A$2:$H$24,'Source Data'!$B$2:$B$24=J2,"No matches")

    Ochimus
    Last edited by Ochimus; 02-12-2022 at 01:55 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. [SOLVED] Additional criteria for existing formula
    By rtprcnb in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 03-01-2020, 03:57 PM
  2. [SOLVED] Adding additional criteria to Max(IF... Formula
    By Terry-J in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-23-2017, 04:57 AM
  3. COUNTIF Formula with additional criteria
    By thackett114 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-30-2014, 09:23 PM
  4. [SOLVED] need to add additional criteria to existing formula
    By Mattr177 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2014, 12:12 AM
  5. [SOLVED] additional criteria for if formula
    By 2001jesper in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-14-2013, 04:25 PM
  6. [SOLVED] Want to add additional criteria to a working formula
    By mrp in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-13-2012, 06:36 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