+ Reply to Thread
Results 1 to 15 of 15

Formulating AM to PM automatically

  1. #1
    Registered User
    Join Date
    07-24-2019
    Location
    US
    MS-Off Ver
    MS Office X64
    Posts
    8

    Formulating AM to PM automatically

    I am currently working on a work week schedule with beginners to the computer world. I have created a spreadsheet which contains the Time in, Lunch in, Lunch out and Time out. At the end of the column I have a total hours per day and at the bottom of the total column I have a total hours for the week.

    Ok, now you can see what I am working on and now to my question. I know if I use the +0.5 it will automatically change. But what I am wondering is, is there a way to have a macro hidden into certain columns so when the people in my office type in 3:00 it will automatically go to 3:00 PM without them having to do anything else but put in their time?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Formulating AM to PM automatically

    How will Excel know that they mean 3pm and not 3am?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-24-2019
    Location
    US
    MS-Off Ver
    MS Office X64
    Posts
    8

    Re: Formulating AM to PM automatically

    I was thinking that I could have the Lunch In, Lunch Out and Time Out defaulted to a PM time and the Time In as the standard AM

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Formulating AM to PM automatically

    That could work as long as you are 100% sure that you will NEVER have a case where it wouldn't work. You need to be certain of this first, so think through all possible scenarios.

  5. #5
    Registered User
    Join Date
    07-24-2019
    Location
    US
    MS-Off Ver
    MS Office X64
    Posts
    8

    Re: Formulating AM to PM automatically

    the only possible scenario I can see is if someone takes a lunch early and/or has to leave early, but for the most part of it would all be set. So if it is possible then if I do whatever I need to do, how if by chance would I fix or maybe have a one time fix in case of the onetime leaving early?

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Formulating AM to PM automatically

    If there is any possibility of it not working, you shouldn't do it.

    Let's see a workbook with a few lines of dummy data covering all possibilities.

  7. #7
    Registered User
    Join Date
    07-24-2019
    Location
    US
    MS-Off Ver
    MS Office X64
    Posts
    8

    Re: Formulating AM to PM automatically

    Time In Lunch In Lunch Out Time Out Hours Total
    12:00 AM 12:00 AM 12:00 AM 12:00 AM 0.00
    8:00 AM 1:00 PM 2:00 PM 5:00 PM 8.00
    8:00 AM 11:15 AM 12:15 PM 5:00 PM 8.00
    8:00 AM 12:00 PM 12:00 PM 9:30 AM 1.50
    8:00 AM 1:00 PM 2:00 PM 5:00 PM 8.00

    this would be the best way I could show you of all possible outcomes. but for the most part people will be working their regular schedule.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Formulating AM to PM automatically

    Will you please attach a small sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    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.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formulating AM to PM automatically

    As far as excel is concerned, Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

    So if your users are entering 3.00 then that is not time, it is just the number 3 (as in 1, 2, 3, 4, 5 etc), wheres 3 (am) = 0.125 and 3 (pm) = 0.625

    Apart from being able to ID 3 AM from 3 PM, you will also need to convert (the number) 3 to a real time - which could possibly mean using a helper column.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Registered User
    Join Date
    07-24-2019
    Location
    US
    MS-Off Ver
    MS Office X64
    Posts
    8

    Re: Formulating AM to PM automatically

    This is the sample I have been working with
    Attached Files Attached Files

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formulating AM to PM automatically

    I dont really see what the problem is here, it looks to me like your times where entered as TIME, along with the Am and PM designation?

    1 small change I would make, would be to maintain TIME throughout ie - dont *24, just format as time 13:30 (under TIME options)

    Also, no need to use SUM there, just =(D3-C3)+(F3-E3)

  12. #12
    Registered User
    Join Date
    07-24-2019
    Location
    US
    MS-Off Ver
    MS Office X64
    Posts
    8

    Re: Formulating AM to PM automatically

    As I stated in the first place, I really don't want to use the army time as alot of the people here do not know/want to calculate army time, I want them to be able to just type in 3:00 or 3:15 or whatever and it automatically calculates it to being AM or PM so when I calculate the time it comes up with 8 hours or how many hours they worked for that day. I am specifically looking to see if there is a macro or something I can put in place so when they type 3:00 it will show up as 3:00 PM and not 3:00 AM

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Formulating AM to PM automatically

    Sonja - this doesn't quite add up. If anyone types 8 into a cell in column C, it does NOT return 8am, so how exactly are your users entering the data?

  14. #14
    Registered User
    Join Date
    07-24-2019
    Location
    US
    MS-Off Ver
    MS Office X64
    Posts
    8

    Re: Formulating AM to PM automatically

    they will usually just type in 8:00 or 8:15.... The thing is in reality if the cells would just have 8:00, 1:00, 2:00, 5:00 and still be able to add up to a day in the total I can work with that, if not then I would need the 1, 2, 5 to all read PM in order for it to add up to a day in the total. but we all type in the hour : minutes

  15. #15
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Formulating AM to PM automatically

    Looking at the sample file Tuesday's lunch in is an AM time, so you couldn't just say that all times in that column are PM.
    What about relieving people of having to type in times and have them pick using a drop down that would only have the correct choices.
    In the attached copy of the sample file, the list of times is in column Q and data validation is applied to C16:F22.
    Note that the times for Saturday and Sunday are left blank.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Formulating a new date
    By hroddy in forum Excel General
    Replies: 1
    Last Post: 02-03-2018, 02:44 AM
  2. Formulating Data
    By Mazzaaa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-16-2016, 06:21 AM
  3. Formulating Data
    By mr.phil in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2013, 05:27 PM
  4. need help formulating
    By duhbiyung in forum Excel General
    Replies: 1
    Last Post: 04-13-2011, 09:48 PM
  5. Formulating Values
    By trunkcase in forum Excel General
    Replies: 1
    Last Post: 07-25-2008, 05:45 PM
  6. formulating Max Lookup(?)
    By DMBFan41 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-21-2007, 06:24 PM
  7. Formulating between worksksheets
    By Jozmoz in forum Excel General
    Replies: 2
    Last Post: 04-08-2006, 02:10 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