Results 1 to 5 of 5

my Select Case function is not working correctly

Threaded View

  1. #1
    Registered User
    Join Date
    12-30-2010
    Location
    somewhere, USA
    MS-Off Ver
    Excel 2010
    Posts
    86

    my Select Case function is not working correctly

    I have a simple list of items in one column and quantity per item in the other column. I needed to create a custom function that would pick up the quantity per item and automatically assign a percentage discount per item based on the quantity of that item.

    Function Guide(Quantity)
        Select Case Guide
            Case Is <= 5
                Guide = 0
            Case 6 To 10
                Guide = 0.1
            Case 11 To 15
                Guide = 0.15
            Case 16 To 20
                Guide = 0.25
            Case 21 To 30
                Guide = 0.3
        End Select
    End Function
    The function is supposed to pick up by looking at the quantity in the original column and automatically assign a discount based on the quantity for that item. But when I run the function...it's giving me zero for all answers! What am I doing wrong?
    Last edited by DorothyFan1; 10-25-2011 at 08:48 AM.

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