+ Reply to Thread
Results 1 to 4 of 4

Custom rounding function

  1. #1
    Registered User
    Join Date
    08-30-2010
    Location
    Palmdale, CA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Custom rounding function

    Hi all,

    I'm new to the forums and new to excel functions and programming. I'm trying to create a custom ROUND function that will allow me to do the following:

    I'm working on a spreadsheet for a university game room that tracks times and then applies a dollar amount based on time played.

    For example:

    If someone plays a game for an hour from 1:00 pm to 2:00 pm they will be charged 1 for that hour. (1 per/hour)

    What I want to do is allow a grace period so that if someone played an extra fifteen minutes they would still only get charged the rate for one hour of play.

    So, if someone played from 1:00 - 2:15 they would be charged 1 dollar but if they played from 1:00 -2:16 (or longer) they would be charged 2 dollars.

    Is there a way to create a custom formula that could allow this?

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,721

    Re: Custom rounding function

    If time played is in A1 try

    =CEILING(MAX(0,(A1*24)-0.25),1)
    Audere est facere

  3. #3
    Registered User
    Join Date
    08-30-2010
    Location
    Palmdale, CA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Custom rounding function

    Quote Originally Posted by daddylonglegs View Post
    If time played is in A1 try

    =CEILING(MAX(0,(A1*24)-0.25),1)
    Thank you! That worked perfectly!

    I actually have another question though!

    Im using the IF function to populate a field like so:

    IF(B4="Student",1,2). Where Column B will either say "student" or "non student"

    The only issue is that since I'm using a large form all the blank fields for colum B that have not been populated, default to the FALSE which is 2. Is there any way to copy the formula to cells without it auto populating the FALSE? That is, I want it to stay blank until columb B is either populated with "student" or "non student"

    I've tried incorporating the AND function but havnt had any luck thus far.
    Last edited by doctordowling; 08-30-2010 at 02:44 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Custom rounding function

    Please start a new thread for your new question.
    Entia non sunt multiplicanda sine necessitate

+ 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