+ Reply to Thread
Results 1 to 20 of 20

Combine Two Formulas

  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:
    Please Login or Register  to view this content.
    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:
    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    Quote Originally Posted by JRock
    If you want the monthly average including the 0 months try:

    =IF(COUNTIF(B3:B14,">0")=12,"N/A",ROUNDUP(AVERAGE(B3:B14),0))
    Exactly what I needed. THANK YOU!

  8. #8
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    ..........
    Attached Files Attached Files

  9. #9
    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:
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    I can't believe I'm still stuck on this!

    I have modified the formula to:
    Please Login or Register  to view this content.
    Which does what I need it to with N/A but will not AVERAGE(B3:B14) unless all 12 month values are there. I need it to calculate if 1-11 are there but not the 12th value.

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    How is this different than my last suggested formula?

  12. #12
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    Instead of the cell reading #DIV/0! when there are no values set for "Usage" it reads N/A (not available), like I need it to.

    But your formula calculate the AVERAGE like it's supposed as mine wont.

  13. #13
    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
    Instead of the cell reading #DIV/0! when there are no values set for "Usage" it reads N/A (not available), like I need it to.

    But your formula calculate the AVERAGE like it's supposed as mine wont.


    So do we have a solution or not?

    I'm not following.

  14. #14
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    I am sorry for being confusing. I'm just trying to get this to come out looking good and functional.

    I have your formula:
    Please Login or Register  to view this content.
    And mine:
    Please Login or Register  to view this content.
    Both work different. Yours works properly to calculate the AVERAGE, but when there is no values in the "Usage" column the cell displays #DIV/0! (I looked into this and it's because Excel is reading that it is dividing my a denomenator of 0).

    Mine does what I would like it to when there is no values in the "Usage" column by displaying N/A, but will not calculate the AVERAGE(B3:B14).

    Also remember that when all 12 month's values are known, I need this cell to show N/A again.

    Thanks again!

  15. #15
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try then perhaps:

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    That did it. I adjusted it a tiny bit to get N/A to look like my other formulas.
    Please Login or Register  to view this content.
    One more part to this, and I'm done.

    I have got:
    Please Login or Register  to view this content.
    &
    Please Login or Register  to view this content.
    and need to combine those. I have tried several times and each time the combonation will only calculate the first part or give me #VALUE!

  17. #17
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    How do you want them combined?

    Please state in words what the conditions are and what result you expect.

  18. #18
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    This formula is going into B19:

    I need to take B16/30 if that cell has a value, if not then I need B17/30.

    If there errors in the above cells (same as we worked out before, if there are no values from the months above the cell shows "N/A") I also need B19 to show "N/A"

    Attached is the new updated workbook if it helps?
    Attached Files Attached Files

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

    =IF(B16="N/A",IF(B17="N/A","N/A",(B17/30)),B16/30)

  20. #20
    Registered User
    Join Date
    10-03-2007
    Posts
    31
    That did the trick. I was trying to fix the error with ISERROR, I guess that's what was throwing me off.

    THANK YOU!

+ 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