+ Reply to Thread
Results 1 to 5 of 5

Need to "read" a cell, and the concert the contents into a math calculation and solve.

  1. #1
    Registered User
    Join Date
    02-10-2017
    Location
    Townsville, Australia
    MS-Off Ver
    Office 365
    Posts
    2

    Cool Need to "read" a cell, and the concert the contents into a math calculation and solve.

    So basically I'm making a staff roster for my cafe in which I'd like to calculate the hours automatically.
    https://1drv.ms/x/s!Aje5ltYIGNV8gexn6KoHbuAVqDMaIQ

    So far I'm managed to get it to read the contents of a pair of parenthesis, in which we type the amount of hours by calculating it ourselves.
    I'd like to hopefully skip this step, so as soon as we type in the rostered start & finish time, it calculates the difference and adds it to the hours calculated at the right and bottom of the sheet.
    I know this could be attained by splitting the start & finish into seperate cells. but I'd prefer to keep the format, as it is in keeping with the style of the other departments.
    I would be happy to change the "Close" time to 2300, but if it's possible to make a case to convert that, it would be terrific.

    Any help would be greatly appreciated.

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

    Re: Need to "read" a cell, and the concert the contents into a math calculation and solve.

    Welcome to the forum!

    Will you please attach a sample Excel workbook? Many members are unable or unwilling to access file-sharing sites.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    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.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-10-2017
    Location
    Townsville, Australia
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Need to "read" a cell, and the concert the contents into a math calculation and solve.

    Hi there, thanks for the advice, attached is the roster, with the Highlighted line in yellow being what I'd like to attain, having manually entered the information.
    Attached Files Attached Files

  4. #4
    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
    53,048

    Re: Need to "read" a cell, and the concert the contents into a math calculation and solve.

    This would be a WHOLE lot simpler if you used 2 columns for each day, and just typed in the actual start and end times in each column. That way you can calc the hours using the built-in time functions in excel
    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

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,769

    Re: Need to "read" a cell, and the concert the contents into a math calculation and solve.

    Try

    in K3

    =IF(B3="RDO",0,(TIMEVALUE((MID(B3,8,2)&":"&MID(B3,10,2)))-TIMEVALUE((MID(B3,1,2)&":"&MID(B3,3,2))))*24)

    I am assuming "Close" become 2300 (and why not).

    BUT as previously stated having start/finish columns is much easier and more sensible.

+ 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] Force "Read Only" only in original spreadsheet - NOT in resultant "saved as" spreadsheets
    By xdrenched in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2016, 01:11 PM
  2. [SOLVED] "Read" the column header "Element" and perform calculation
    By dwsf in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-15-2015, 01:41 AM
  3. "Coloring macro" and a "copy if cell contents are .." macro are interfering
    By dreddster in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2015, 08:30 AM
  4. Replies: 4
    Last Post: 05-30-2013, 10:36 PM
  5. "Form and macro" to delete "Active" cell contents.
    By wanty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2013, 11:33 PM
  6. Replies: 6
    Last Post: 03-14-2012, 01:01 AM
  7. Replies: 1
    Last Post: 12-12-2005, 11:15 AM

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