+ Reply to Thread
Results 1 to 20 of 20

Combine Two Formulas

Hybrid View

  1. #1
    Registered User
    Join Date
    10-03-2007
    Posts
    31

    Combine Two Formulas

    Working on the same simple chart NBVC helped me on, but this is for AVERAGE instead of SUM and with an added variable.

    I've come up with this, which works:
    =IF(COUNTIF(B3:B14,">0"),(AVERAGE(B3:B14)))
    Then needed to add; IF(B17,"N/A"). I tried using AND getting an error of too many arguments?

    This also works to give me N/A but not the the AVERAGE I need if B17 is not N/A:
    =IF(COUNTIF(B3:B14,">0"),IF(B17,"N/A"),(AVERAGE(B3:B14)))
    Thanks for your help!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You need to use the ISNA() function to determine TRUE/FALSE for a cell to contain the #N/A error...

    e.g.. =IF(ISNA(B17),.....)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    Not quite sure that's working out. I have never used that, so it may be me.

    B17 says N/A when it can't get a total from the all 12 months from above.
    If B17 says N/A I need B16 (cell to hold this formula) to show the AVERAGE of the 12 months. If B17 has a total, then B16 needs to show N/A.

    I also still need COUNTIF in there too, I need a 0 showing with no data for the above months. (COUNTIF(B3:B14,">0")

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    ...a little confusing....

    but if I take you literally...then I come up with this:

    =IF(COUNTIF(B3:B14,">0"),IF(ISNA(B17),AVERAGE(B3:B14),NA()),0)

    is this what you need?

  5. #5
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    Having the same problem with that formula as I was mine.

    It gives me N/A preceded with a # sign (not sure why), but is still will not calculate the AVERAGE when all the values are not available.

    Here is the file so you can see what I have so far.

    Thank you again for the help!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-17-2004
    Posts
    14

    Try These

    So I didn't know if you only wanted the average of the months with values or the months with the zero months included. So if you want an average of just the months available, try.

    =IF(COUNTIF(B3:B14,">0")=12,"N/A",ROUNDUP(SUM(B3:B14)/COUNTIF(B3:B14,">0"),0))

    If you want the monthly average including the 0 months try:

    =IF(COUNTIF(B3:B14,">0")=12,"N/A",ROUNDUP(AVERAGE(B3:B14),0))

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by SOMLSS1
    Having the same problem with that formula as I was mine.

    It gives me N/A preceded with a # sign (not sure why), but is still will not calculate the AVERAGE when all the values are not available.

    Here is the file so you can see what I have so far.

    Thank you again for the help!
    Try also:
    =IF(COUNT(B3:B14)=12,NA(),ROUNDUP(AVERAGE(B3:B14),0))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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