+ Reply to Thread
Results 1 to 16 of 16

Countif and array formula help

  1. #1
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Countif and array formula help

    Hello,

    I believe this involves an array formula but i can't get it to work.
    I need a shorter formula that can count how many times the individual cells in 'classes'!B1:AO1 appear in 'Enrolment Map'!J5:GX5

    right now my formula, which works, looks like this

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    there must be a shorter way to write this formula.

    thanks
    Attached Files Attached Files
    Last edited by dosydos; 01-14-2016 at 05:09 PM.

  2. #2
    Forum Contributor
    Join Date
    07-16-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2013
    Posts
    176

    Re: Countif and array formula help

    a sample workbook maybe helpful, otherwise, look at my formula, it may give you some idea.
    Attached Files Attached Files
    Last edited by igoodable; 01-14-2016 at 05:09 PM.

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Countif and array formula help

    @ igoodable agreed with you
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  4. #4
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Countif and array formula help

    file attatched on original post

  5. #5
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Countif and array formula help

    i think that will work igoodable..thanks

  6. #6
    Registered User
    Join Date
    08-17-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Countif and array formula help

    Try this formula, this is not an array:

    I put it in cell B2 on the "classes" tab and dragged it across to the last column.

    HTML Code: 

  7. #7
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Countif and array formula help

    copy paste below then hold control and shift together and then hit enter to make it array formula

    where ever you want to apply
    =SUM(MMULT(--((classes!B1:AO1)=TRANSPOSE('Enrolment Map'!J5:GX5)),ROW(1:40)^0))

  8. #8
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Countif and array formula help

    Quote Originally Posted by igoodable View Post
    a sample workbook maybe helpful, otherwise, look at my formula, it may give you some idea.
    actually igoodable i am unable to put the {} when it is referring to the classes tab. Any other ideas?

  9. #9
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Countif and array formula help

    Quote Originally Posted by hemesh View Post
    copy paste below then hold control and shift together and then hit enter to make it array formula

    where ever you want to apply
    =SUM(MMULT(--((classes!B1:AO1)=TRANSPOSE('Enrolment Map'!J5:GX5)),ROW(1:40)^0))
    I tried yours hemesh but it is coming up with a value of 220... the value should be 13.
    i am re uploading the file here. In cell B4 i have my very long equation which is the one i want shortened in cell B6. My guess was an array formula needed to be used.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Countif and array formula help

    copy paste below then hold control and shift together and then hit enter to make it array formula

    where ever you want to apply
    =SUM(COUNTIF(B1:AO1,'Enrolment Map'!J5:GX5))

    When you use key combination of Control shift and Enter then time curly braces comes automatically confirming formula was entered as an array formula you dont type them manually

    if you want to drag formula down the lock the cell references
    Last edited by hemesh; 01-14-2016 at 05:37 PM.

  11. #11
    Forum Contributor
    Join Date
    07-16-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2013
    Posts
    176

    Re: Countif and array formula help

    it looks like you have to use an array formula. after you enter the formula hold control + shift + enter

    Enter this formula on your sheet on b8

    Please Login or Register  to view this content.
    Note: I hate array formulas, it's a resource hog, it's acceptable on smaller data set such as this.
    Last edited by igoodable; 01-14-2016 at 05:40 PM.

  12. #12
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Countif and array formula help

    Quote Originally Posted by igoodable View Post
    it looks like you have to use an array formula. after you enter the formula hold control + shift + enter

    Enter this formula on your sheet on b8

    Please Login or Register  to view this content.
    Note: I hate array formulas, it's a resource hog, it's acceptable on smaller data set such as this.
    This just worked thank you very much, i am very slow when it comes to arrays for some reason, cant quite wrap my head around them.

  13. #13
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Countif and array formula help

    @ dosydos what's the difference in formula between post #10 and #12 and both will work in same way
    in formula in post 10 it follows your range suggested.

    Both formula does the same thing

  14. #14
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Countif and array formula help

    it didnt work in the first formula because i was stupid and tried putting the brackets on the inside.

  15. #15
    Forum Contributor
    Join Date
    07-16-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2013
    Posts
    176

    Re: Countif and array formula help

    You can also put the brackets inside, but you cannot reference to another cell. The former formula is a regular formula, where as the latter is an array formula.

  16. #16
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Countif and array formula help

    @ dosydos ! if this solves your query you can mark thread as solved

+ 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. COUNTIF with array formula
    By rmckee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2012, 01:57 PM
  2. Replies: 3
    Last Post: 02-07-2012, 10:52 AM
  3. Array Formula COUNTIF & SUM not working
    By jojithedevil in forum Excel General
    Replies: 2
    Last Post: 02-22-2010, 06:49 PM
  4. [SOLVED] Array formula using two columns and countif
    By Dave in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-12-2006, 02:10 PM
  5. [SOLVED] Help Please - CountIf and Array formula
    By Prickle in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2006, 09:10 AM
  6. [SOLVED] I need to create an array formula combined with a countif
    By Rochelle B in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-25-2005, 01:05 AM
  7. Countif array formula
    By Bruce in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-14-2005, 04:05 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