+ Reply to Thread
Results 1 to 9 of 9

Count Within Set of Cells

  1. #1
    Registered User
    Join Date
    09-05-2022
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    4

    Count Within Set of Cells

    Hi,

    We have a sheet that represents outstanding orders. Each order could be one or more lines long. I've created a helper column in Column D to make it easier to identify individual orders.

    I am trying to create a formula that identifies order lines that:

    Are not ready to pick (No in column B in the attached)
    Are already in WIP (YES in column C in the attached)
    Are the last line needed to complete that order - it is this third part that I can't work out.

    What we want is to only put a yes in column F if that is the last line waiting for that order. So in the attached F28 would be YES (that line not ready to pick, is already in WIP and is the last line for that order) F37 and F41 should not have a YES though as they are both for the same order and so there is more than one line waiting.

    I've tried a few things like countif but I'm not sure how to get it to restart the count for each order...

    Thanks!

    Count Within Order.xlsx

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Count Within Set of Cells

    Try this in F2:

    =IF(COUNTIF(A$2:A2,LEFT(A2,FIND("-",A2)-1)&"*")=COUNTIF(A:A,LEFT(A2,FIND("-",A2)-1)&"*"),"yes","")

    Copy down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Count Within Set of Cells

    F2=COUNTIF($A$2:$A2,$A2)=COUNTIF($A$2:$A$4697,$A2)

    G2=IF(AND($B2=$K$1,$C2=$L$1,$F2=$M$1),"yes","")

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    09-05-2022
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Count Within Set of Cells

    Hi Both,

    Thanks for the formulas. Unfortunately neither work quite right.

    Pete_UK this seems to just highlight where the conditions are met for the individual line and not take into account if it is the last line for the order.

    oelder this seems to almost give the result I'm after but I think it is just looking to see if the line is unique rather than if all of the other order lines are Ready to Pick (for example row 3025 should not be shown as "yes" as there are a number of other lines on that order which are not ready to pick either.

    Thanks again

    Matt

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Count Within Set of Cells

    oeldere this seems to almost give the result I'm after but I think it is just looking to see if the line is unique rather than if all of the other order lines are Ready to Pick (for example row 3025 should not be shown as "yes" as there are a number of other lines on that order which are not ready to pick either.

    Info of line 3025
    226868-22 NO YES 361 TRUE TRUE yes


    1) What did you expect as result?

    2) and why did you expect that result?
    Last edited by AliGW; 09-05-2022 at 11:08 AM. Reason: Code tags changed to quote tags.

  6. #6
    Registered User
    Join Date
    09-05-2022
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Count Within Set of Cells

    HI,

    Expected result would be:

    226868-22 NO YES 361 TRUE TRUE blank

    Reason is that the following lines (which are the same order) are not available to pick (column B is no)

    3016
    3017
    3018
    3019
    3020
    3021
    3022
    3024
    3026
    3027
    3028

    Thanks

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Count Within Set of Cells

    Cell F2=COUNTIF($D$2:$D2,$D2)=COUNTIF($D$2:$D$4697,$D2)

  8. #8
    Registered User
    Join Date
    09-05-2022
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Count Within Set of Cells

    Hi oeldere, that seems to be working great.

    Thanks very much for your help.

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Count Within Set of Cells

    Glad I could help.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation , to all members who helped 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] Count grey cells and count filled cells excluding AL, ML
    By NatalieW12 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-05-2021, 11:46 AM
  2. [SOLVED] How to COUNT cells until streak ends + how to COUNT cells under certain value
    By zakazano in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-09-2020, 12:02 PM
  3. Replies: 7
    Last Post: 03-09-2020, 07:11 PM
  4. Replies: 1
    Last Post: 05-19-2017, 07:37 AM
  5. [SOLVED] Formula needed to only count total cells entered and not count adjacent text entered cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-07-2013, 06:22 PM
  6. [SOLVED] count cells that contain text but do not count cells containing only a formula
    By cprpacific in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-13-2013, 03:15 PM
  7. [SOLVED] Count in a range, where identical adjacent cells count as one instance.
    By the-algebraist in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-05-2013, 11:18 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