+ Reply to Thread
Results 1 to 7 of 7

Is there a way in a formula to add an unknown later input number

  1. #1
    Registered User
    Join Date
    10-07-2018
    Location
    Wichita Falls, TX
    MS-Off Ver
    365
    Posts
    10

    Is there a way in a formula to add an unknown later input number

    I am looking for help to create a formula to do the following scenario. In let say cell B3 I want to be able to enter SDO + (a changing value) and be able to transfer it to another cell on the same sheet say B50.

    For example an employee works their day off "SDO" which equals 8 hours of overtime but sometimes they work over the 8 hours thus would have to add the additional time which could vary from time to time.

    So what I have done is use the formula =if(B3="SDO",8,0) which makes it to where the SDO inputed in B3 equals the 8 hour value but say the employee worked 9.45 hours how would I make it to where I can add the additional 1.45 hours to the 8 hours in B3 and make it come out to 9.45 in B50?
    Last edited by Chris1972; 10-07-2018 at 06:29 PM. Reason: title change

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Is there a way in a formula to add an unknown later input number

    It's not clear to me exactly what you intend to enter in B3. So.... please do so in a sample sheet and post it (along with a fewother examples AND your expected results).

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    04-30-2015
    Location
    The Netherlands
    MS-Off Ver
    office 365
    Posts
    195

    Re: Is there a way in a formula to add an unknown later input number

    You would need an additional helper column where you enter the overtime hours. You could, that way, change your formula to

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


    The cell you put this formula in should be formatted as a time. B3 holds the word SDO (or not) like you had before. C3 holds the overtime hours (also time formatted)

    Ferdy
    Remember to mark as Solved and give out rep.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Is there a way in a formula to add an unknown later input number

    If I understood well your idea of:
    I want to be able to enter SDO + (a changing value)
    then try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    for SDO or SDO8 or SDO8.0 it shall return 8, but for SDO9.5 there will be 9.5
    Best Regards,

    Kaper

  5. #5
    Registered User
    Join Date
    10-07-2018
    Location
    Wichita Falls, TX
    MS-Off Ver
    365
    Posts
    10

    Re: Is there a way in a formula to add an unknown later input number

    In Kaper's post that is exactly what I was needing but can someone explain to me what all that means on the formula to help me better understand the values or post an example of the same thing applied to make c4 do the same thing and maybe I can figure it out.
    Attached Files Attached Files
    Last edited by Chris1972; 10-08-2018 at 08:43 AM.

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Is there a way in a formula to add an unknown later input number

    if the value in the cell is just SDO, then return 8, otherwise you want the value from a cell that starts at the 4th character to the end. However the mid function returns values as text so -- has the strange property of turning text to a number. If it does not start SDO then return 0

    I usually multiply by 1 which has the same effect

    =if(left(B3,3)="SDO",if(len(B3)=3,8,mid(B3,4,1000)*1),0)

  7. #7
    Registered User
    Join Date
    10-07-2018
    Location
    Wichita Falls, TX
    MS-Off Ver
    365
    Posts
    10

    Re: Is there a way in a formula to add an unknown later input number

    Perfect. Thank y'all for the help.

+ 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. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  2. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  3. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  4. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  5. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

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