+ Reply to Thread
Results 1 to 16 of 16

have a cell display what another cell displays, not the numerical value

  1. #1
    Registered User
    Join Date
    06-17-2014
    Location
    canada
    MS-Off Ver
    2013
    Posts
    24

    have a cell display what another cell displays, not the numerical value

    So im making a timesheet for work. I have one worksheet displaying Time Start and Time Finish for each shift. This is entered for example as 8:00:00 AM and the cell will display 8:00 AM (for start time) and 4:00:00PM displayed as 4:00 PM (for time finished)

    I then have another cell that is supposed to show "8:00 AM - 4:00PM"

    I have tried using:
    C3 &" - " &D3
    but it shows as a numerical time value "0.333333333 -"

    Anyone know what im doing wrong?

  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,740

    Re: have a cell display what another cell displays, not the numerical value

    Please attach the workbook.
    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
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: have a cell display what another cell displays, not the numerical value

    Maybe like this:

    8:00:00AM is formatted as time

    4:00:00PM is formatted as text

    Just check with right click your mouse both of C3 and D3, If you combine value with text formatted, yes you can, but if there is data with time formatted, the'll showed up as number...

  4. #4
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: have a cell display what another cell displays, not the numerical value

    Hi,

    Please try the following:

    =CONCATENATE(TEXT(C3,"H:MM AM/PM"),"-",TEXT(D3,"H:MM AM/PM"))

  5. #5
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: have a cell display what another cell displays, not the numerical value

    Use the =TEXT() function.

    Assume your 8:00 AM is in A2 and your 4:00 PM is in B2, your formula would be =TEXT(A2,"hh:mm AM/PM")&" - "&TEXT(B2,"hh:mm AM/PM")

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: have a cell display what another cell displays, not the numerical value

    welcome to the forum, kranic3. the above solutions will work for you, but let me address your question of what you are doing wrong. Excel recognises dates as integers & time as decimals. to verify, type in 1jan2013 in A1. and 12 pm in B1. Format both cells to General. you will see that A1 is 41275 (meaning 41,275th day from 1 Jan 1900) & B1 is 0.5 (1/2 a day). so 8 am is 0.333333333; 1/3 of a day. that's why you need the TEXT formula as suggested

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  7. #7
    Registered User
    Join Date
    06-17-2014
    Location
    canada
    MS-Off Ver
    2013
    Posts
    24

    Re: have a cell display what another cell displays, not the numerical value

    thanks guys, that did it (=CONCATENATE(TEXT(C3,"H:MM AM/PM"),"-",TEXT(D3,"H:MM AM/PM"))

    is there a way for me to use that entire formula within another in an if/then statement to print OFF if no time is entered?

    thanks again

  8. #8
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: have a cell display what another cell displays, not the numerical value

    Hi,

    Yes, you can do that:

    =IF(OR(C3="",D3=""),"OFF",CONCATENATE(TEXT(C3,"H:MM AM/PM"),"-",TEXT(D3,"H:MM AM/PM")))

  9. #9
    Registered User
    Join Date
    06-17-2014
    Location
    canada
    MS-Off Ver
    2013
    Posts
    24

    Re: have a cell display what another cell displays, not the numerical value

    last question guys, and i really do appreciate all this help.

    Any way to add another IF/THEN to subtract .5h for lunch on shifts 5 hours and over?

  10. #10
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: have a cell display what another cell displays, not the numerical value

    Hi,

    Please find the attached file (sample template) for subtracting shifts over 5 hours.

    Regards,
    Chandra




    Please click on ‘* Add Reputation’ if this was helpful
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-17-2014
    Location
    canada
    MS-Off Ver
    2013
    Posts
    24

    Re: have a cell display what another cell displays, not the numerical value

    Sorry, i should have been more specific.
    I have attached my file. In Sheet2 in the totals column (P) is there a way to create an addition to the formula that will subtract .5h off of each day in that week with a value of 5 or larger.

    Im not asking you to do the work for me either (if this is coming across rude) I am more than willing to put in time on this, i am just struggling with a bit :P
    Attached Files Attached Files

  12. #12
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: have a cell display what another cell displays, not the numerical value

    What you mean by "with a value of 5 or larger. "? Does it mean that if somebody is present for 5 or more days in a week then 0.5 hours need to be deducted from each day?

  13. #13
    Registered User
    Join Date
    06-17-2014
    Location
    canada
    MS-Off Ver
    2013
    Posts
    24

    Re: have a cell display what another cell displays, not the numerical value

    i need to have .5hrs subtracted from each day that is 5 hours or longer (preferably without creating a new column, but just adding that to the current totaling formula)

  14. #14
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: have a cell display what another cell displays, not the numerical value

    Please find attached the updated file.

    Regards,
    Chandra


    Please click on ‘* Add Reputation’ if this was helpful
    Attached Files Attached Files

  15. #15
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: have a cell display what another cell displays, not the numerical value

    An alternate simpler way to calculate the total hours..
    Attached Files Attached Files

  16. #16
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: have a cell display what another cell displays, not the numerical value

    another way:
    =(SUMIF($B$2:$O$2,"Out",B3:O3)-SUMIF($B$2:$O$2,"In",B3:O3))*24-SUMPRODUCT(((($B$2:$O$2="Out")*(B3:O3)-($B$2:$O$2="In")*(B3:O3))>=5/24)*0.5)

+ 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] When one cell equals value of another cell, then third cell displays text of fourth cell?
    By spookymyo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2021, 02:12 PM
  2. Edit Cell Colour if other cell displays specific text
    By macky18 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2013, 07:46 AM
  3. Replies: 0
    Last Post: 06-26-2013, 08:46 PM
  4. Display numerical result of a cell with Text as well
    By davidcrawt in forum Excel General
    Replies: 3
    Last Post: 11-26-2012, 03:27 PM
  5. For Loop & display a msgbox for numerical value of each cell
    By Astroboy142 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-06-2009, 09:19 PM

Tags for this Thread

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