+ Reply to Thread
Results 1 to 4 of 4

need formula to average cells but if one cell has N/A then dont average and input N/A

  1. #1
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    need formula to average cells but if one cell has N/A then dont average and input N/A

    I have two cells that i need to average unless one cell has N/A in it. Then I want it to just say N/A. Currently the following formula will average and will input N/A only if both cells have N/A. If one has N/A it just inputs the numeric value of the other cell.

    =IF(($B27="N/A")*OR($C27="N/A"),"N/A",AVERAGE($B27:$C27))

    So if B or C have N/A then I want D to say N/A.
    Last edited by CityInspector; 08-08-2013 at 04:16 PM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: need formula to average cells but if one cell has N/A then dont average and input N/A

    Do you mean?

    =IF(OR($B27="N/A",$C27="N/A"),"N/A",AVERAGE($B27:$C27))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  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,929

    Re: need formula to average cells but if one cell has N/A then dont average and input N/A

    or maybe...

    =if(count($B27:$C27)<>counta(),"N/A",average($B27:$C27))
    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
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: need formula to average cells but if one cell has N/A then dont average and input N/A

    Quote Originally Posted by Fotis1991 View Post
    Do you mean?

    =IF(OR($B27="N/A",$C27="N/A"),"N/A",AVERAGE($B27:$C27))
    Thanks, that worked perfectly. For some reason i didnt think to put the "Or" first.

+ 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. Replies: 14
    Last Post: 06-14-2013, 09:00 PM
  2. Replies: 10
    Last Post: 04-25-2013, 06:12 PM
  3. Average formula that starts at first cell>0 and calculates blank cells as 0?
    By bradtredo in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-20-2012, 05:54 PM
  4. The rank of average ranks excluding empty cells but including their average.
    By Terminal45 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2012, 03:44 AM
  5. numbers dont average correctly
    By gold9er in forum Excel General
    Replies: 6
    Last Post: 07-19-2012, 03:37 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