+ Reply to Thread
Results 1 to 10 of 10

GoogleSheets: Result based on unique and countif formula

  1. #1
    Registered User
    Join Date
    02-13-2016
    Location
    maharashra
    MS-Off Ver
    excel-2007
    Posts
    18

    GoogleSheets: Result based on unique and countif formula

    Hi,,
    please suggest suitable formula in google sheets ,, for result,,
    1) Column A contains digits having yymm
    2) column B contains numbers
    3) unique values of column B in column C
    4) counted occurrences in column D
    5) Result should show digits of column A corresponding to only unique values of column c ..
    working in google sheets..
    Attached Files Attached Files

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

    Re: Result based on unique and countif formula

    Administrative Note:

    Is your forum profile showing the version of Excel that you need this to work for?

    Members will tailor the solutions they offer to the version of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this.

    The three most recent versions of Excel are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the release number in your profile (e.g. MS365 Version 2211). This is in the About Excel section further down the Account page.

    Thanks.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    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 (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: GoogleSheets: Result based on unique and countif formula

    Thread moved to the correct section - please add GoogleSheets to your forum profile (see above).

  4. #4
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: GoogleSheets: Result based on unique and countif formula

    2) column B contains numbers

    No it doesn't

    ---

    4) counted occurrences in column D

    How are we supposed to count the numbers in column A that are equal to the letters in column B?

    ---

    5) Result should show digits of column A corresponding to only unique values of column c ..

    We wont necessarily reach this point unless you can explain points 2 and 4.

    ---

    To save everyones time, here is sample Google Sheet that we can continue development of the solution:

    https://docs.google.com/spreadsheets...gid=2100307022

    Please provide more clear explanation regarding points 2 and 4, and we can take it from there.
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

  5. #5
    Registered User
    Join Date
    02-13-2016
    Location
    maharashra
    MS-Off Ver
    excel-2007
    Posts
    18

    Re: GoogleSheets: Result based on unique and countif formula

    1) column b contains numbers
    2) column c is unique values from column b
    3) column d is no of occurrences for unique values
    4) column e,f,g,h,i,j in sheet 3 of development sheet provided should give result for corresponding yymm data of column a..

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: GoogleSheets: Result based on unique and countif formula

    Column B does NOT contain numbers!!!

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    B
    1
    AB
    2
    AB
    3
    CD
    4
    EF
    5
    CD
    6
    AB
    7
    EF
    8
    GH
    9
    HI
    10
    JK
    11
    GH
    Sheet: Sheet1

  7. #7
    Registered User
    Join Date
    02-13-2016
    Location
    maharashra
    MS-Off Ver
    excel-2007
    Posts
    18

    Re: GoogleSheets: Result based on unique and countif formula

    Yes , by mistake it is written in Text, But new sheet 3 is created for desired results which is added in link provided.. https://docs.google.com/spreadsheets...gid=2100307022

  8. #8
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: GoogleSheets: Result based on unique and countif formula

    Final solution...

    Sort unique in C2:
    =SORT(UNIQUE(B2:B),1,1)

    Get count of occurrences in D2:
    =ARRAYFORMULA(IF(C2:C="",,COUNTIF(B2:B,C2:C)))

    1st yymm in E2:
    =BYROW($C$2:$C,LAMBDA(serial,IF(serial="",,ARRAYFORMULA(INDEX(SPLIT(TEXTJOIN(", ", TRUE, IF($B$2:$B=serial, $A$2:$A, "")),", "),1,1)))))

    2nd yymm in F2:
    =BYROW($C$2:$C,LAMBDA(serial,IF(serial="",,ARRAYFORMULA(IFERROR(INDEX(SPLIT(TEXTJOIN(", ", TRUE, IF($B$2:$B=serial, $A$2:$A, "")),", "),1,2))))))


    subsequent yymm in G2 onwards, simply change the last digit 2 to get the next index, so G2 is:
    =BYROW($C$2:$C,LAMBDA(serial,IF(serial="",,ARRAYFORMULA(IFERROR(INDEX(SPLIT(TEXTJOIN(", ", TRUE, IF($B$2:$B=serial, $A$2:$A, "")),", "),1,3))))))


    Due to the amount of data being processed, these arrayformulas stake a long time to get the results... so be patient when waiting for results to update.

    Also, in the source data there is nothing with more than 3 yymm, so the 4th and subsequent appear empty.

    yymm.jpg

  9. #9
    Registered User
    Join Date
    02-13-2016
    Location
    maharashra
    MS-Off Ver
    excel-2007
    Posts
    18

    Re: GoogleSheets: Result based on unique and countif formula

    Thanks for help , formula worked ..

  10. #10
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: GoogleSheets: Result based on unique and countif formula

    Quote Originally Posted by YOGESHP View Post
    Thanks for help , formula worked ..
    When you have a working solution, it is customary to mark the topic as "Solved".

    Also, Thank you for the reps, it is very appreciated.

+ 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] GoogleSheets: IfVlookup on different sheet - with result of Y
    By Asdf99 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 7
    Last Post: 06-29-2022, 11:11 AM
  2. [SOLVED] Find count of unique numbers with countif based on another cell?
    By Badvgood in forum Excel General
    Replies: 8
    Last Post: 10-06-2020, 01:03 PM
  3. Countif on the result of a formula on 2 columns
    By krissysteen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2019, 09:20 AM
  4. [SOLVED] Linking 1 tab to another based on a cell result, picks a column based on result formula
    By MattExcelLearner in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-23-2018, 11:08 AM
  5. [SOLVED] Sumif based on the RESULT of a Countif
    By Betsy Simpkins in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-13-2018, 01:16 PM
  6. Count unique values in columns based on 2 criteria (error in one result)
    By t83357 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-17-2013, 03:25 PM
  7. Countif formula help to get a certain result with 2 conditions.
    By Nitinkumar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-15-2013, 07:13 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