+ Reply to Thread
Results 1 to 3 of 3

Formula based on contents of adjacent cells?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-24-2010
    Location
    North West UK
    MS-Off Ver
    2013
    Posts
    112

    Formula based on contents of adjacent cells?

    Hi All,

    I have a complex question but I'll have to give you a bit of background relating to the problem:

    I'm using an excel spreadsheet for my work to record the hours that agency drivers work. The spreadsheet records (in column D of the attached file) the day of the week they work. The day of the week determines the hourly rate the driver gets paid, this bit I have done with a formula that works ok.

    After this column the next column (E) records the amount of hours they work.

    Should the drivers hours overlap to the another day, for example say 11pm on a Monday and finishes on 8am on Tuesday then the day is recorded in column F and the amount of hours also recorded in G.

    Any overtime is recorded in column H.

    The rates (where this problem lies) are in columns I & J.

    The rates differ depending on the day that they work, for example weekends, bank holidays etc. What I want to do at the bottom of the spreadsheet is add up all the hours but I want totals of all the hours at the different rates.

    My attached spreadsheet would probably explain it better, if you need to know more feel free to let me know.

    Thanks
    Lewis
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-11-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    149

    Re: Formula based on contents of adjacent cells?

    1) First, your problem in column L is that the formulas in J & K are using a text value of "£ 0.00". You should really change it to just 0 so it's a numeric and let the cell formatting add the pound sign and spaces.

    2) What I think you're looking for is the SUMIF function. So E24 would be: =SUMIF(I$3:I$18,G24,E$3:E$18)+SUMIF(J$3:J$18,G24,G$3:G$18)+SUMIF(K$3:K$18,G24,H$3:H$18) You can then drag the formula down to the other rows for it to work w/ the other rates.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula based on contents of adjacent cells?

    Quote Originally Posted by masteff
    =SUMIF(I$3:I$18,G24,E$3:E$18)+SUMIF(J$3:J$18,G24,G$3:G$18)+SUMIF(K$3:K$18,G24,H$3:H$18)
    being a pedant you could actually amalgamate the latter two SUMIFs into one

    E24: =SUMIF(I$3:I18,G24,E$3:E$18)+SUMIF(J$3:K$18,G24,G$3:H$18)

    Unfortunately the layout of Standard Time precludes a single SUMIF.

+ 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