+ Reply to Thread
Results 1 to 8 of 8

2 Formulas to combine into CountIF's

  1. #1
    Registered User
    Join Date
    07-15-2014
    Location
    Poynton, England
    MS-Off Ver
    Office 365
    Posts
    13

    2 Formulas to combine into CountIF's

    I am trying to build a spreadsheet which I want to consolidate onto one page. I have made a Countif formula that works for counting new cars. I have made a counIF's formula that work for how many cars in each month.

    What I need is a countif formula that will count new cars from a perticular month feeding from a set cel. In my spreadsheet the cells are C3 for month and C4 to select new or used.

    I hope this makes sense. I'm sure its something I am missing that is simple but I have been working on it for about 1 hr.

    EDIT: Should've said using the formula I am making it comes up with an error #VALUE as per cell B17 on the main screen.

    Thanks for your help,

    Steve
    Attached Files Attached Files
    Last edited by Slinky84; 03-14-2018 at 12:03 PM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: 2 Formulas to combine into CountIF's

    The last criteria range in the formula is using standard cell reference.
    Mazda!E8:E118
    Should be using Table Reference
    Mazda[New/Used]
    So the formula in B17 should be
    =COUNTIFS(Mazda[Delivery Date],">="&(VLOOKUP(C3,Control!C17:F28,3,FALSE)+0),Mazda[Delivery Date],"<="&(VLOOKUP(C3,Control!C17:F28,4,FALSE)+0),Mazda[New/Used],"="&C4)

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: 2 Formulas to combine into CountIF's

    I see what you were going for with the table reference, and i'm not really sure why that wasn't working, but this seems to be.

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


    i might come back to this later to see if i can figure out why the table reference wasn't doing what it should.

    ****EDIT****
    Immediately after posting the table references started working for me again. not sure what happened there, but the New/Used reference running form 8 to 118 instead of 5 to 118 was your problem. all ranges in the countifs formula have to be the same length. or, as was already stated, just change all of them to table references.
    Last edited by simarui; 03-14-2018 at 12:10 PM.
    Hope I could help - if your post has been solved don't forget to mark it as such.

    Clicking the * below is a great way to say thanks!

    "Drowning in 10 feet of water isn?t any different than drowning in a million feet. And if you can swim, it doesn?t matter how deep the ocean is. At some level, once you realize you?re in water that?s too deep to stand, you have to have a very different approach," - Joi Ito

  4. #4
    Registered User
    Join Date
    07-15-2014
    Location
    Poynton, England
    MS-Off Ver
    Office 365
    Posts
    13

    Re: 2 Formulas to combine into CountIF's

    Thank you so much, out of interest what difference does it make using a table reference instead?

  5. #5
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: 2 Formulas to combine into CountIF's

    i just edited my comment to add that, but it was that you were running from E8:E118 while your table runs from row 5 to 118

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: 2 Formulas to combine into CountIF's

    Counting the number of New cars for a given month?

    =SUMPRODUCT((TEXT(Mazda!A5:A118,"mmm")=C3)*(Mazda!E5:E118=C4))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: 2 Formulas to combine into CountIF's

    It's not just that you used regular reference instead of table references.
    As simarui mentioned, all the ranges have to be the same size in countifs.

    Your table covered rows 5 to 118
    But your standard reference covered rows 8 to 118

    So your formula has that mixed up.
    You can reference either way, just as long as the references are of equal dimensions.

  8. #8
    Registered User
    Join Date
    07-15-2014
    Location
    Poynton, England
    MS-Off Ver
    Office 365
    Posts
    13

    Re: 2 Formulas to combine into CountIF's

    Thanks for the help guys

+ 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] Combine COUNTIF with OR
    By blens1 in forum Excel General
    Replies: 13
    Last Post: 04-04-2015, 12:34 PM
  2. [SOLVED] combine countif formulas into 1 formula
    By skip2mylew in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2013, 07:32 PM
  3. [SOLVED] Combine vlookup and countif formulas
    By StrydomM in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-31-2013, 01:44 AM
  4. [SOLVED] Using Combine macro to combine multiple worksheets - need to modify to paste formulas
    By DLSmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2012, 09:07 AM
  5. [SOLVED] Combine two formulas to count (countif and productsum)
    By keis386 in forum Excel General
    Replies: 2
    Last Post: 07-24-2012, 03:36 AM
  6. Do I need to combine hlookup and countif?????
    By sharkh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-17-2006, 12:05 PM
  7. [SOLVED] How do I combine 2 COUNTIF formulas??
    By MANDY in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-19-2006, 02:10 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