+ Reply to Thread
Results 1 to 19 of 19

calculating money formula

  1. #1
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    calculating money formula

    this is going to be hard to explain but i will do my best because im stuggling to put this into words correctly.

    i have a setup page and on that i have hourly rates.

    i have a database that has formulas in them which calculate costs etc based on these figures. (you will need to see the sheet to see what i mean)

    i have two sheets that do this

    1. Daily Agency Input
    2. Full Time D I


    my problem is this.

    with regards to the Daily Agency Input: on the userform it asks you what agency you worked for and what company you worked for. however not every company pays the same rate which is noted on the Agency_Contractor sheet

    thus i need a code to work out the pay based on what company someone is working for and change the hourly rate accordingly without effecting previous days week month entries.

    this is the same problem for the full time driver as well, as they may change jobs and so different pay will be given.

    here is my workbook for your review if someone could help me please

    https://www.dropbox.com/s/pi4huc483g...0one.xlsm?dl=0

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: calculating money formula

    I would modify the userform

    So that whatever values the userform displays, the user can type a value in an adjacent textbox.

    The userform would them use that value for its calculation.

    Please Login or Register  to view this content.
    While we are at it, I always display Data in labels to stop the user overwriting them

    So I would use:-

    Please Login or Register  to view this content.
    On Second thoughts if you are displaying your rates in textboxes and the user modifies the value then that would work in your scenario.
    Last edited by mehmetcik; 04-10-2015 at 01:44 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: calculating money formula

    what does "night" mean? this formula returns a specific pay rate based on the contract, the weekday and the start time (if start time greater than 5:00pm it returns the night value)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    does that get you going in the right direction?
    Hope I could help - if your post has been solved don't forget to mark it as such.

    Clicking the * below is a great way to say thanks!

    "Drowning in 10 feet of water isn?t any different than drowning in a million feet. And if you can swim, it doesn?t matter how deep the ocean is. At some level, once you realize you?re in water that?s too deep to stand, you have to have a very different approach," - Joi Ito

  4. #4
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    Quote Originally Posted by mehmetcik View Post
    I would modify the userform

    So that whatever values the userform displays, the user can type a value in an adjacent textbox.

    The userform would them use that value for its calculation.

    Please Login or Register  to view this content.
    While we are at it, I always display Data in labels to stop the user overwriting them

    So I would use:-

    Please Login or Register  to view this content.
    would that not require a change to alot of code on the workbook.

    could you do an example using my workbook please so i can fully understand what it is that you are suggesting please

  5. #5
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    and where does that formula go btw
    Last edited by Learning ExL; 04-10-2015 at 01:50 PM.

  6. #6
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    Quote Originally Posted by simarui View Post
    what does "night" mean? this formula returns a specific pay rate based on the contract, the weekday and the start time (if start time greater than 5:00pm it returns the night value)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    does that get you going in the right direction?
    Night out is what a driver does if they are out/parked up over night and they get say £21 for being out for the night and where is that formula going btw

  7. #7
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    Quote Originally Posted by mehmetcik View Post
    I would modify the userform

    So that whatever values the userform displays, the user can type a value in an adjacent textbox.

    The userform would them use that value for its calculation.
    But could the same not be done but using the information on the agency contractor sheet as that has the pay rates for a company on there

  8. #8
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: calculating money formula

    i wrote my formula such that it could go anywhere, but i think it makes most sense to include it in the Agency_Daily_Input tab, starting on row 9. you could also include that in a formula (it returns a $/hr value so you could multiply that whole formula by the # of hours kinda like you're doing in column L)

    and i apologize for not being clear, when i said "what does night mean" what i really mean is "what criteria would result in a driver receiving night pay" ... the way i set it up a driver receives night pay if they start after 5:00 PM but if you want all night hours to be charged at one rate and all day hours charged at another that would be a slightly different formula.

  9. #9
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    P
    Quote Originally Posted by simarui View Post
    i wrote my formula such that it could go anywhere, but i think it makes most sense to include it in the Agency_Daily_Input tab, starting on row 9. you could also include that in a formula (it returns a $/hr value so you could multiply that whole formula by the # of hours kinda like you're doing in column L)

    and i apologize for not being clear, when i said "what does night mean" what i really mean is "what criteria would result in a driver receiving night pay" ... the way i set it up a driver receives night pay if they start after 5:00 PM but if you want all night hours to be charged at one rate and all day hours charged at another that would be a slightly different formula.
    No new to appologise bud. I've just gone with what is common around where I live. I need to see a working example if possible please if that's OK sir

  10. #10
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    I'd also need to incorporate this into the user form as well

  11. #11
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    [QUOTE=simarui;4042618]what does "night" mean? this formula returns a specific pay rate based on the contract, the weekday and the start time (if start time greater than 5:00pm it returns the night value)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Learning ExL; 04-11-2015 at 02:48 AM.

  12. #12
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    Quote Originally Posted by simarui View Post
    what does "night" mean? this formula returns a specific pay rate based on the contract, the weekday and the start time (if start time greater than 5:00pm it returns the night value)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    does that get you going in the right direction?
    does that get you going in the right direction?[/QUOTE]

    ok after i had some sleep and i came back to this i had a fresh head on. and realized some mistakes in understanding on both our parts.

    i tested this formula and noted it works with the right hand set of figures on the Agency Contract rates but not the left hand side, although the formula covers both sides.

    now....i understand where and why you asked about "Nights" which i can see there being a little problem because i need to add a button of sorts to the userform asking if the shift is:

    A) Nights or Days (which alleviates the problem of when to start the nights out)
    B) if the driver is on overtime after 8 hours (first set of figures on the left) or
    C) if the driver is on a flat rate (right hand set of figures)

    not sure how to code the userform for that at the moment.

    here is my file which changes on userform

    https://www.dropbox.com/s/7ts3zs3fkt...Copy.xlsm?dl=0
    Last edited by Learning ExL; 04-11-2015 at 03:42 AM.

  13. #13
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    the formula would need to take into account the two options eg

    paid over time after 8 hours or

    if the whole day is at a flat rate

  14. #14
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    Please Login or Register  to view this content.
    Hi Sir.

    id like to know if its possible to change the width of this formula at all.

    at the moment it looks up C9:T10, but i noticed that when i put figures only in cols I to N i get an error of #Ref which i cant understand why. so what i did was delete those cols and again i got #REF but i changed the T10 to N10 and it wasnt having any of it. can you help please.

    im assuming that all i should be able to change is T10 to N10

    Please Login or Register  to view this content.
    and it come up with #REF!
    Last edited by Learning ExL; 04-16-2015 at 05:07 AM.

  15. #15
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    any suggestions anyone

  16. #16
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: calculating money formula

    your issue is that you're asking the vlookup formula to return a column that is outside of the search range.

    vlookup works like this: =vlookup([what am i looking for?],[what is the range i should include in my results? (the first column in this range must be the column in which you are expecting to find your value, and the last column should be the last column from which you expect to return a result)],[which column from that range would you like me to return?],[do you need an exact match? if so, type false, otherwise type true... i almost always default to false here, but if your data is sorted properly you can use true])

    All of the stuff in those if() statements is telling excel which column to return. basically the if statements are saying if the date is monday through friday return the 13th column, if it's saturday return the 15th column and if it's sunday return the 17th column. then it's also adding 1 to those numbers if the start time is after 5:00pm.

    by reducing the width of your range all those column numbers would need to change to align with the new desired results (i.e. count how many columns away from C you find your new rate)

    it is possible to make these #'s more dynamic with index(match()). looks like your dropbox link provided above is no longer working so i'm not exactly sure what to give you there. you can attach a file directly to this thread by clicking go advanced below the reply box and then clicking on the paperclip icon, add file etc...

    also i still don't really understand what you mean with A) B) and C) in the earlier description, but i think seeing the file and your new userform would probably make that more clear. it sounds like the last piece of my if() statements in the above formula (which toggles "night" based on start time) should not be included.

  17. #17
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    Quote Originally Posted by simarui View Post
    your issue is that you're asking the vlookup formula to return a column that is outside of the search range.

    vlookup works like this: =vlookup([what am i looking for?],[what is the range i should include in my results? (the first column in this range must be the column in which you are expecting to find your value, and the last column should be the last column from which you expect to return a result)],[which column from that range would you like me to return?],[do you need an exact match? if so, type false, otherwise type true... i almost always default to false here, but if your data is sorted properly you can use true])

    All of the stuff in those if() statements is telling excel which column to return. basically the if statements are saying if the date is monday through friday return the 13th column, if it's saturday return the 15th column and if it's sunday return the 17th column. then it's also adding 1 to those numbers if the start time is after 5:00pm.

    by reducing the width of your range all those column numbers would need to change to align with the new desired results (i.e. count how many columns away from C you find your new rate)

    it is possible to make these #'s more dynamic with index(match()). looks like your dropbox link provided above is no longer working so i'm not exactly sure what to give you there. you can attach a file directly to this thread by clicking go advanced below the reply box and then clicking on the paperclip icon, add file etc...

    also i still don't really understand what you mean with A) B) and C) in the earlier description, but i think seeing the file and your new userform would probably make that more clear. it sounds like the last piece of my if() statements in the above formula (which toggles "night" based on start time) should not be included.
    ok i got that formula working

    i have another is ive been trying to work out using your method

    Please Login or Register  to view this content.
    here is an up dated version of my workbook

    https://www.dropbox.com/s/z9qkgxe2x7...orum.xlsm?dl=0

  18. #18
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: calculating money formula

    Please Login or Register  to view this content.
    i tried this and it just comes back #VALUE!

    then i did this

    Please Login or Register  to view this content.
    if yes i get the correct value

    if no i get False

    Please Login or Register  to view this content.
    then i did above code and it works, you vlookup now copied and pasted for later reference. many thanks sir i really mean it
    Last edited by Learning ExL; 04-16-2015 at 05:28 PM.

  19. #19
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: calculating money formula

    glad you got it working. for reference, unless you need to check that it actually says "No" and not something else or blank or w/e you can actually drop that second embedded if statement. i.e. it seems like this would accomplish your task:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    that formula will return a blank if anything other than "Yes" is found in f9.

    as for your first formula that was returning false, did you mean to check D9 in the second if statement? you're checking f9 at first and then d9 later... your first formula would've worked if "No" was found in d9. it returned false because "Yes" was not in F9 and "No" was not in d9 and you didn't give the second if formula a [value if false]. so with your current, "working" formula i suspect you're not actually returning a blank because you found the word "No" ... you're returning a blank because you didn't find the word "No" in d9 (the value after the second comma in that second if statement).

    make sense?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula To Split The Money
    By jackgan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-16-2014, 10:03 AM
  2. Formula for Drawing Down on a Pool of Money
    By deli9680 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-27-2013, 02:11 PM
  3. Formula to calculate money due
    By 1.zer0 in forum Excel General
    Replies: 4
    Last Post: 01-21-2011, 05:23 AM
  4. Calculating money from two cells
    By Existant in forum Excel General
    Replies: 2
    Last Post: 12-02-2010, 11:01 PM
  5. Pls help with date and money formula!
    By gingermatti in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-29-2009, 05:42 AM

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