+ Reply to Thread
Results 1 to 14 of 14

Ignore blank cells

  1. #1
    Registered User
    Join Date
    10-04-2009
    Location
    Colchester, England
    MS-Off Ver
    Office 365
    Posts
    30

    Question Ignore blank cells

    Hi All,

    I have been using this excellent forum to help me set up an assessment spreadsheet (attached)

    The idea is that staff enter a fine grade e.g. C1,C2,C3,D1,D2,D3 etc and then for each aspect an average is worked out.

    I have managed to undertake this when all cells are filled in however when a cell does not have a grade this average does not seem to work as it counts blank cells for an average so if there are only 2 grades as in row 4 entered a result is not returned.

    So is there a way to ignore blank cells when carrying out the formulae in column X,Y and AA.

    Many thanks

    Olly
    Attached Files Attached Files
    Last edited by Teacher; 08-20-2011 at 01:32 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Ignore blank cells

    Using your posted workbook, this regular formula returns the Average End Unit tests
    Y3: =IF(COUNTIF(AE3:AJ3,"0")=6,"no data",LOOKUP(ROUND(SUMPRODUCT((AE3:AJ3=Code)*Scale) / COUNTIF(AE3:AJ3,"<>0"),0), Scale, Code))

    Copy that formula down as far as you need.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Ignore blank cells

    Hi,

    Averages imply you are working with numeric values which I can't see in the relevant parts of your worksheet. Can you explain exactly what results you expect to see with some examples.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    10-04-2009
    Location
    Colchester, England
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Ignore blank cells

    Being fine grades each grade could be 1,2 or 3. Say for e.g. C1, C1, C3, C3 I would expect the average to be C2. If you look to the far right you can see a scale assignedto each grade. This thereby allows an "average" to be worked out.

    Hope this is clearer. Will try that Ron.

    Olly

  5. #5
    Registered User
    Join Date
    10-04-2009
    Location
    Colchester, England
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Ignore blank cells

    Ron it works perfectly many thanks for that

  6. #6
    Registered User
    Join Date
    10-04-2009
    Location
    Colchester, England
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Ignore blank cells

    I am trying to now average the last column "AC" but I cant seem to get this one to work as if there is "no data" or blank comment it returns an error, or calculates this wrong e.g AC4 or 5.

    Many thanks in advance.

    Olly
    Attached Files Attached Files

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Ignore blank cells

    Try changing the formula in AC3 from this:
    =IF(COUNTIF(Y3:AB3,"0")=4,"no data",LOOKUP(ROUND(SUMPRODUCT((Y3:AB3=Code)*Scale) / COUNTIF(Y3:AB3,"<>0"),0), Scale, Code))

    to this:
    =IF(COUNTIF(Y3:AB3,"??")=0,"no data",LOOKUP(ROUND(SUMPRODUCT((Y3:AB3=Code)*Scale) / COUNTIF(Y3:AB3,"<>0"),0), Scale, Code))

    Copy the amended formula down.

    Does that help?

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Ignore blank cells

    PHP Code: 
    =IF(COUNTBlank(Y3:AB3)=0,"no data",LOOKUP(ROUND(SUMPRODUCT((Y3:AB3=Code)*Scale) / COUNT(Y3:AB3),0), ScaleCode)) 



  9. #9
    Registered User
    Join Date
    10-04-2009
    Location
    Colchester, England
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Ignore blank cells

    Ron,

    Thanks for you assistance it almost works, if there is a value in any of the 4 columns YtoAB then it returns a value if there is one or more missing then the average is wrong.

    SNB I wanted the average if one or two figures were missing that formula returns no data if one or more is missing

    Thanks in advance

    Olly
    Attached Files Attached Files

  10. #10
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Ignore blank cells

    Ooops! My mistake...
    AC3: =IF(COUNTIF(Y3:AB3,"??")=0,"no data",LOOKUP(ROUND(
    SUMPRODUCT((Y3:AB3=Code)*Scale)/COUNTIF(Y3:AB3,"??"),0), Scale, Code))

    Better?

  11. #11
    Registered User
    Join Date
    10-04-2009
    Location
    Colchester, England
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Ignore blank cells

    Ron.

    Thanks very much for your time... Just two things:

    1) is there any formula to mke sure staff complete this

    2) I can formulate most formulas however I am not sure what the ?? and 0 mean in this part you used: COUNTIF(Y3:AB3,"??")=0,"no data",

  12. #12
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Ignore blank cells

    Quote Originally Posted by Teacher View Post
    Ron.

    Thanks very much for your time... Just two things:

    1) is there any formula to mke sure staff complete this

    2) I can formulate most formulas however I am not sure what the ?? and 0 mean in this part you used: COUNTIF(Y3:AB3,"??")=0,"no data",
    In this section:
    COUNTIF(Y3:AB3,"??")=0,"no data"

    This part: COUNTIF(Y3:AB3,"??")
    returns the count of cells containing 2-characters of text ("?" is a wildcard for any single character)
    So, in the IF function...if there are no 2-char cells, return: "no data", otherwise calculate the average of the available items.

    Does that help?

  13. #13
    Registered User
    Join Date
    10-04-2009
    Location
    Colchester, England
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Ignore blank cells

    Thats great, I do get stuck on the finer details but hopefully will learn little bits.

    I am rolling out 7 spreadsheets for staff to use from September down from over 15 currently, this is the last one I am working on and thanks to you its all completed.

  14. #14
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Ignore blank cells

    Glad to help!

+ 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