+ Reply to Thread
Results 1 to 4 of 4

Help with if statement

  1. #1
    Registered User
    Join Date
    06-21-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help with if statement

    I am trying to create a weighted average grade book.The user can select what percentage to weigh each category. I have set up a row of cells to allow the user to be able to select one of the following categories: HW, PJT, FIN, WKS, TST. All the calculations will be computed out of the users sight. I need to create an if statement that will let a cell be zero if one of the fields mentioned above is not selected. In cell F38 I have tried =IF(D2:Y2<>"WKS",0,AVERAGEIF($D$2:$Y$2,"WKS",$D$3:$Y$3)),but for some reason it is not working correctly. Can someone please help me Ive been trying to figure it out for hours already and I'm sure its some thing simple. I have attached the file, so you can understand what im trying to say because its hard to type it out.

    thanks in advance
    GradeBook-1.xlsx

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Help with if statement

    logixoner,

    I'd recommend using the Counif() formula to check if something exists within a range of cells:
    =IF(COUNTIF($D$2:$Y$2,"WKS")=0,0,AVERAGEIF($D$2:$Y$2,"WKS",$D$3:$Y$3))

    Attached is a modified version of your workbook so you can see how it works

    Hope that helps,
    ~tigeravatar
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-21-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help with if statement

    Tigeravatar,

    Thank you sooooo much...this is exactly what i needed!!!

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Help with if statement

    You can use IFERROR function,

    =IFERROR(AVERAGEIF($D$2:$Y$2,"WKS",$D$3:$Y$3),0)

    http://office.microsoft.com/en-us/ex...001231765.aspx
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ 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