+ Reply to Thread
Results 1 to 6 of 6

Help needed with countif formula

  1. #1
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Help needed with countif formula

    Hi all,
    So I have a data set that looks something like this:

    Main
    Main
    Main
    Shade
    Main
    Shade
    Shade



    Now I want to count cells like this

    1 Main
    2 Main
    3 Main
    4 Shade
    5 Main
    6 Shade
    6 Shade

    So each time if its main then it should continue the count, but if it's shade then it should count all the items in that range as a single one like no. 6 in the above example.


    Thanks

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Help needed with countif formula

    If your text is in col A starting at A2, in B2 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Is that what you are looking for?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Help needed with countif formula

    @ChemistB: Unless I'm missing something, your formula seems to give: 1,2,3,3,4,4,4 What am I missing??

    Here's another possibility I think (if I'm understanding right)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    >>>>> EDIT: No! See corrected formula in post #5
    Last edited by GeoffW283; 05-31-2019 at 12:28 PM.
    Geoff

    Did I help significantly? If you wish, click on * Add Reputation to say thanks.
    If your problem has been resolved please select ?Solved? from the Thread Tools menu

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Help needed with countif formula

    @Geoff,
    Yes, I didn't test my formula. You're right.

  5. #5
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Help needed with countif formula

    And somehow there was a mistake in my formula too.

    Corrected post #3 formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95
    Quote Originally Posted by ChemistB View Post
    If your text is in col A starting at A2, in B2 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Is that what you are looking for?
    Thanks a million

+ 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] COUNTIF formula help needed
    By MattExcelLearner in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-25-2019, 05:29 AM
  2. Help Needed: How to build formula? - CountIf(s), MRound, IndexMatch
    By ReetzX in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-24-2019, 09:54 AM
  3. VBA version of countif formula needed
    By qclady in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-16-2016, 07:39 AM
  4. Possible VLOOKUP COUNTIF Calculation Formula help needed
    By formexcel in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-12-2016, 01:40 PM
  5. [SOLVED] Countif formula help needed
    By bigband1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-22-2015, 09:55 AM
  6. Formula needed for countif or countifs (may also need a sumif)
    By Petefav in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2013, 02:18 AM
  7. Formula needed for COUNTIF in current month
    By atomickitty in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-02-2012, 03:00 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