+ Reply to Thread
Results 1 to 8 of 8

Adding and using function if in the same cell

  1. #1
    Registered User
    Join Date
    12-28-2016
    Location
    Kettering, England
    MS-Off Ver
    MS OFFICE 2016
    Posts
    4

    Adding and using function if in the same cell

    Hi everyone,

    I have this really helpful forum, and I can see there is a lot of very high skilled excel users, however I couldn't find answer I am seeking. I am doing payroll and I wanted to simplify my work. As you can in the picture or file, I have 3 examples there, I managed to count total hours(C2) and hours worked(D2) (minus 30min lunch brake), So my question is: ''How can I do Total Hrs (C2) and Hrs worked (D2) in one cell in this case (C2), I have tried something like:

    =(B2-A2)*24,if(C2>5,C2-0.5,C2)

    I did tried to search in google(and of cource in this forum) and to watch in youtube, but unfortunately unsuccessful. You can see it works in separate cells, but I would like to know how to do it in one cell. Thank you

    Would like to apologize if topic like this already exist.

    work.jpg
    Attached Files Attached Files

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

    Re: Adding and using function if in the same cell

    Is this what you mean?

    =IF(((B2-A2)*24)>5,((B2-A2)*24)-0.5,(B2-A2)*24)
    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
    12-28-2016
    Location
    Kettering, England
    MS-Off Ver
    MS OFFICE 2016
    Posts
    4

    Re: Adding and using function if in the same cell

    Thank you AliGW, this is exactly what i meant.

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

    Re: Adding and using function if in the same cell

    You're welcome!

  5. #5
    Registered User
    Join Date
    12-28-2016
    Location
    Kettering, England
    MS-Off Ver
    MS OFFICE 2016
    Posts
    4

    Re: Adding and using function if in the same cell

    Sorry I have just noticed there is some words missing from my thread. Probably when I edited text.

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

    Re: Adding and using function if in the same cell

    Which words are missing?

  7. #7
    Registered User
    Join Date
    12-28-2016
    Location
    Kettering, England
    MS-Off Ver
    MS OFFICE 2016
    Posts
    4
    Quote Originally Posted by AliGW View Post
    Which words are missing?
    I mean my first post, but it doesnt matter anymore as the problem is solved. Thanks again.

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

    Re: Adding and using function if in the same cell

    OK. Thanks for clarifying.

+ 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. adding result of a function to a cell already containing a value
    By Amir2007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-31-2015, 02:34 PM
  2. Replies: 8
    Last Post: 04-28-2014, 01:51 AM
  3. [SOLVED] Adding cell values via a function results in #VALUE!
    By davehartleyuk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2014, 10:56 AM
  4. [SOLVED] adding cell format in created VBA function
    By Röbke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2014, 10:31 AM
  5. [SOLVED] Formula for adding a percentage from one cell and adding the total of 2 others
    By Kandra in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-04-2013, 06:48 AM
  6. [SOLVED] Adding two cells containing SUM function adding up to zero
    By ra3940 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-18-2012, 01:28 PM
  7. Adding a Function to a cell when inserting a row from a macro
    By Mbarnes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-31-2006, 11:45 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