+ Reply to Thread
Results 1 to 5 of 5

How to create a custom function

Hybrid View

Guest How to create a custom... 08-01-2006, 08:10 PM
Guest Re: How to create a custom... 08-01-2006, 10:10 PM
Guest Re: How to create a custom... 08-01-2006, 10:20 PM
Guest Re: How to create a custom... 08-01-2006, 11:30 PM
Guest Re: How to create a custom... 08-02-2006, 12:10 AM
  1. #1
    Marcie
    Guest

    How to create a custom function

    I need to create a custom function called LetterGrade that uses two arguments
    TotalPossible and TotalPoints based on the following;
    If percentage of TotalPoints/TotalPossible is >=90% the letter grade should
    be an A, etc. When I type the word percentage it shows an error. do I need
    to define percentage if so how.

    Sorry I am new at this and any help would be appreciated.

    Also I need to declare a variable GradePercentage that calculates
    TotalPoints/TotalPossible and compare the gradePercentage to letter grade
    cutoffs and return appropriate letter grade from lettergrade function.

    I would appreciate and help or examples on this that might help.
    thank you,
    Marcie

  2. #2
    Steve Yandl
    Guest

    Re: How to create a custom function

    Marcie,

    This doesn't answer your question entirely but it is probably enough of a
    head start to let you set something up:
    http://www.cpearson.com/excel/excelF.htm#Grades

    Steve



    "Marcie" <Marcie@discussions.microsoft.com> wrote in message
    news:0E19670B-BFC6-4469-BDC1-9AA980E643E6@microsoft.com...
    >I need to create a custom function called LetterGrade that uses two
    >arguments
    > TotalPossible and TotalPoints based on the following;
    > If percentage of TotalPoints/TotalPossible is >=90% the letter grade
    > should
    > be an A, etc. When I type the word percentage it shows an error. do I
    > need
    > to define percentage if so how.
    >
    > Sorry I am new at this and any help would be appreciated.
    >
    > Also I need to declare a variable GradePercentage that calculates
    > TotalPoints/TotalPossible and compare the gradePercentage to letter grade
    > cutoffs and return appropriate letter grade from lettergrade function.
    >
    > I would appreciate and help or examples on this that might help.
    > thank you,
    > Marcie




  3. #3
    Marcie
    Guest

    Re: How to create a custom function

    Steve, thank you but how do I write "If the percentage of TotalPoints
    etc...." when I type "If percentage of total..." I cant use the word
    percentage in my formula. do you know how I can get it to work? Do I need
    to type something defining percentage of total?
    Thanks

    "Steve Yandl" wrote:

    > Marcie,
    >
    > This doesn't answer your question entirely but it is probably enough of a
    > head start to let you set something up:
    > http://www.cpearson.com/excel/excelF.htm#Grades
    >
    > Steve
    >
    >
    >
    > "Marcie" <Marcie@discussions.microsoft.com> wrote in message
    > news:0E19670B-BFC6-4469-BDC1-9AA980E643E6@microsoft.com...
    > >I need to create a custom function called LetterGrade that uses two
    > >arguments
    > > TotalPossible and TotalPoints based on the following;
    > > If percentage of TotalPoints/TotalPossible is >=90% the letter grade
    > > should
    > > be an A, etc. When I type the word percentage it shows an error. do I
    > > need
    > > to define percentage if so how.
    > >
    > > Sorry I am new at this and any help would be appreciated.
    > >
    > > Also I need to declare a variable GradePercentage that calculates
    > > TotalPoints/TotalPossible and compare the gradePercentage to letter grade
    > > cutoffs and return appropriate letter grade from lettergrade function.
    > >
    > > I would appreciate and help or examples on this that might help.
    > > thank you,
    > > Marcie

    >
    >
    >


  4. #4
    NickHK
    Guest

    Re: How to create a custom function

    Marcie,
    Don't use percentages; 0.9

    NickHK

    "Marcie" <Marcie@discussions.microsoft.com> wrote in message
    news:BEB591E3-5B0C-45A4-9260-64DD5FE684AA@microsoft.com...
    > Steve, thank you but how do I write "If the percentage of TotalPoints
    > etc...." when I type "If percentage of total..." I cant use the word
    > percentage in my formula. do you know how I can get it to work? Do I

    need
    > to type something defining percentage of total?
    > Thanks
    >
    > "Steve Yandl" wrote:
    >
    > > Marcie,
    > >
    > > This doesn't answer your question entirely but it is probably enough of

    a
    > > head start to let you set something up:
    > > http://www.cpearson.com/excel/excelF.htm#Grades
    > >
    > > Steve
    > >
    > >
    > >
    > > "Marcie" <Marcie@discussions.microsoft.com> wrote in message
    > > news:0E19670B-BFC6-4469-BDC1-9AA980E643E6@microsoft.com...
    > > >I need to create a custom function called LetterGrade that uses two
    > > >arguments
    > > > TotalPossible and TotalPoints based on the following;
    > > > If percentage of TotalPoints/TotalPossible is >=90% the letter grade
    > > > should
    > > > be an A, etc. When I type the word percentage it shows an error. do I
    > > > need
    > > > to define percentage if so how.
    > > >
    > > > Sorry I am new at this and any help would be appreciated.
    > > >
    > > > Also I need to declare a variable GradePercentage that calculates
    > > > TotalPoints/TotalPossible and compare the gradePercentage to letter

    grade
    > > > cutoffs and return appropriate letter grade from lettergrade function.
    > > >
    > > > I would appreciate and help or examples on this that might help.
    > > > thank you,
    > > > Marcie

    > >
    > >
    > >




  5. #5
    skatonni via OfficeKB.com
    Guest

    Re: How to create a custom function

    Marcie

    This will get you what you want:

    Function LetterGrade(TotalPossible, TotalPoints)
    Dim gradePer As Double

    gradePer = TotalPoints / TotalPossible * 100

    If gradePer >= 90 Then
    LetterGrade = "A"
    ElseIf gradePer >= 80 Then
    LetterGrade = "B"
    ElseIf gradePer >= 70 Then
    LetterGrade = "C"
    ElseIf gradePer >= 60 Then
    LetterGrade = "D"
    Else
    LetterGrade = "F"
    End If

    End Function


    You can save time by not calculating the percentage.

    Function LetterGrade2(TotalPossible, TotalPoints)
    Dim gradePer As Double

    gradePer = TotalPoints / TotalPossible

    If gradePer >= 0.9 Then
    LetterGrade2 = "A"
    ElseIf gradePer >= 0.8 Then
    LetterGrade2 = "B"
    ElseIf gradePer >= 0.7 Then
    LetterGrade2 = "C"
    ElseIf gradePer >= 0.6 Then
    LetterGrade2 = "D"
    Else
    LetterGrade2 = "F"
    End If

    End Function


    Marcie wrote:
    >Steve, thank you but how do I write "If the percentage of TotalPoints
    >etc...." when I type "If percentage of total..." I cant use the word
    >percentage in my formula. do you know how I can get it to work? Do I need
    >to type something defining percentage of total?
    >Thanks
    >
    >> Marcie,
    >>

    >[quoted text clipped - 22 lines]
    >> > thank you,
    >> > Marcie


    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...mming/200608/1


+ 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