+ Reply to Thread
Results 1 to 4 of 4

Combining Multiple IF(COUNTIF) Functions

  1. #1
    Registered User
    Join Date
    10-13-2015
    Location
    Denver, CO
    MS-Off Ver
    2010
    Posts
    1

    Combining Multiple IF(COUNTIF) Functions

    Hi there! So I am trying to set up a cell formula that will read information from a row, determine if an employee's name is present, and if so add a value from a third cell. If his name is not present, then 0 will be added to the current cell. Here is what I have come up with so far, which works:

    =IF(COUNTIF(D11:I11,"Avery")>0,+K11,W17+0)

    Where D11:I11 is the row range, "Avery" is the associates name, +K11 is the value from the third cell, and W17 is current cell with the formula in it.

    However, I need to utilize this same formula for 14 total rows, but combine them into the same cell (which I have so far been unable to get to work). So basically I need to combine the following formulae:

    =IF(COUNTIF(D11:I11,"Avery")>0,+K11,W17+0)
    =IF(COUNTIF(D12:I12,"Avery")>0,+K12,W17+0)
    =IF(COUNTIF(D13:I13,"Avery")>0,+K13,W17+0)
    =IF(COUNTIF(D14:I14,"Avery")>0,+K14,W17+0)
    =IF(COUNTIF(D15:I15,"Avery")>0,+K15,W17+0)
    etc...

    Is this something that is possible? Thank you!

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,593

    Re: Combining Multiple IF(COUNTIF) Functions

    Welcome to the forum. Several things have to be assumed in formulating a solution, which is why it is better to "Go Advanced" and upload a sample file.
    1) The summation will be in W17.
    2) There is already some value assigned to W17.
    3) There are assigned values in K11:K24

    This solution utilizes a great feature of a spreadsheet which is that you have a lot of real estate to work with so you can use helper columns (I used column X so that you could see how things are working, but you could just as easily use column XFD, and you can always hide whatever column you use). I put the following formula in X11:
    Please Login or Register  to view this content.
    and after I entered the formula I dragged the fill handle down to X24 (which automatically changed the row numbers in the formula as I went). I then entered the following formula in W17:
    Please Login or Register  to view this content.
    where 25 is the value pre-assigned to W17. Take a look at the attached file and see if this solution meets your needs.

    Combining Functions.xlsx

    Let me know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Combining Multiple IF(COUNTIF) Functions

    Hi, welcome to the forum

    [QUOTE]Where D11:I11 is the row range, "Avery" is the associates name, +K11 is the value from the third cell, and W17 is current cell with the formula in it.[/QUOTE]

    Do you mean that your formula is going into W17? If so, this will cause a circular error - something you need to avoid at all costs, unless you have a specific need for that.

    Aslo, why are you adding 0?
    =IF(COUNTIF(D11:I11,"Avery")>0,+K11,W17+0)

    If you want to count something over a range or rows, just include the whole range...
    =IF(COUNTIF(D11:I15,"Avery")>0,K11,W170)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining Multiple IF(COUNTIF) Functions

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Combining IF COUNTIF AND functions
    By sbala in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-11-2015, 12:47 PM
  2. Need help combining advanced countif functions....
    By capy12 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-30-2013, 11:25 AM
  3. Combining Functions Countif & Frequency
    By vagabond in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-10-2010, 08:04 AM
  4. Combining IF and COUNTIF functions
    By cbee907 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-26-2010, 11:35 AM
  5. [SOLVED] Combining LOOKUP and COUNTIF functions
    By kate_suzanne in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-22-2006, 02:05 AM
  6. [SOLVED] Combining COUNTIF and AND functions
    By david in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 07-06-2006, 10:00 PM
  7. [SOLVED] combining countif and mid or right functions
    By Charles Woll in forum Excel General
    Replies: 5
    Last Post: 07-09-2005, 08:05 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