+ Reply to Thread
Results 1 to 6 of 6

Formula to append a certain number of formulas

  1. #1
    Registered User
    Join Date
    05-14-2009
    Location
    Tustin, CA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Formula to append a certain number of formulas

    Hello!

    I am going to do my best to explain this. The idea is quite simple, but to explain might come off as confusing. I will do my best. I want to create a time card to track my own time on projects. Since I take numerous breaks I "clock in" and "clock out" many times in a day (for 10 minutes, 12 minutes, etc) and I want to log the time that I spend only in "work mode". Here's my format
    A B C D
    1 Monday Clock in1 Clock in2 Clock in3
    2 Clock out1 Clock out2 Clock out3
    3
    4 Tuesday...
    5
    --------
    10 Monday Tuesday Wednesday
    11 *totals *totals *totals

    So I have it set up to count the number of days input with the =CountA formula. It counts how many cells in row 2 are filled. In this case it'd come up with the number "3".

    What I then need it to do is write a formula that subtracts Clock out1 from Clock In1 and multiply by 24. Right now I have: " =(SUM(A2,-A1)*24).
    -->Here's the kicker, if the Counta formula comes up with a 3, then it will add each subsequent SUM formula to the original formula (3 in this case). If CountA comes up with 2, it will only add up the hours for the 2 time slots that are filled.

    Any ideas?

    Thank you for any help!
    Matt

  2. #2
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 and 2010 @ Home & Teach 2010
    Posts
    351

    Re: Formula to append a certain number of formulas

    Let me know if this is what you are after.
    Attached Files Attached Files
    Yes it will. we just have to figure out how...
    If I have helped you, PLEASE click the * and add to my Rep.
    Also, if the problem is SOLVED please mark it as so.

  3. #3
    Forum Contributor mubashir aziz's Avatar
    Join Date
    03-18-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    MS Office 2013
    Posts
    533

    Re: Formula to append a certain number of formulas

    i think a sample file can be helpfull to sort out your problem .....
    If this post helps, Please don't 4get to click the star icon located at the bottom left of my Post.

  4. #4
    Registered User
    Join Date
    05-14-2009
    Location
    Tustin, CA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Formula to append a certain number of formulas

    Quote Originally Posted by Dunc3142 View Post
    Let me know if this is what you are after.
    This spreadsheet is the simplistic idea of what I was trying to accomplish. Yes it will work just fine so thanks! but what I was going for was a way to use a formula that counts how many cells are filled for 1 day and then creates a formula with the amount of cells that are filled. The reason being is one day I could work straight through for 12 hours with no breaks, another day I could work an hour, take a 15 minute break, work 3 hours, take 20 minutes, work an hour, take 45. etc...so if it goes over the 5 clockin/clockout range we have set in this spreadsheet, I'd have to update the formulas...I don't want to have to do that, I want the formula to know how many times to do it.

    Let's say for the sake of argument and an attempt to explain this clearer (believe me it's hard for me to explain this, I know what I want, but I don't really know the lingo!)

    A= Number of filled cells per day. Clock In/Clock Out sets.
    B"#"= The formula (clock out - clock in), # = which set.

    It's Monday, I clock in and out 3 times.
    A= 3
    I want a formula in excel to create the formula: B1+B2+B3*24

    Tuesday, I clock in and out once.
    A= 1
    Formula: B1*24

    Wednesday, I clock in and out 6 times
    Formula: B1+B2+B3+B4+B5+B6*24

    I want Excel to be able to do this automatically without me having to update the formulas for each day.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formula to append a certain number of formulas

    No attachment.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Formula to append a certain number of formulas

    It will ignore blank cells so jsut set it as wide as you want!

    =(SUM(D11:T11)-SUM(D10:T10))*24

    assuming T is your maximum column to enter into

    it ignores blanks!
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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