+ Reply to Thread
Results 1 to 3 of 3

Lookup or SUMIF ??

  1. #1
    Registered User
    Join Date
    08-23-2006
    Posts
    26

    Lookup or SUMIF ??

    Hi - i reckon there is an easy answer to this but just cannot work it out...

    I've got a months worth of work data - I can use the SUMIF function if I want to total 1 days worth of work in the sheet however each date can be split further into 3 shifts, say A, B and C. If I want to look for a specific date and shift how would I do this??

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

    Re: Lookup or SUMIF ??

    You can use SUMPRODUCT

    F1: =SUMPRODUCT(--($A$1:$A$10=$D$1),--($B$1:$B$10=$E$1))

    Where A holds dates and D1 holds criteria, and B holds shift & E1 holds criteria.

    (If using XL2007 you can use COUNTIFS but this is not backwards compatible)

    An alternative would be to create a concatenation key at source, eg:

    C1: =$A1&":"&$B1
    copied down to C10

    You can then dispense with array use traditional COUNTIF utilising the new concatenation column - this is arguably preferable method to Sumproduct ... more so with big models...

    F1: =COUNTIF($C$1:$C$10,$D$1&":"&$E$1)

    EDIT

    To SUM if we assume we insert a column such that A holds date, B holds Shift & C holds values to sum .. criteria values are moved to E1 (date) & F1 (shift) then:

    SUMPRODUCT approach:

    =SUMPRODUCT(--($A$1:$A$10=$E$1),--($B$1:$B$10=$F$1),$C$1:$C$10)

    Using concatenation where D holds concatenation of A & B, SUMIF approach:

    =SUMIF($D$1:$D$10,$E$1&":"&$F$1,$C$1:$C$10)
    Last edited by DonkeyOte; 02-26-2009 at 07:50 AM.

  3. #3
    Registered User
    Join Date
    08-23-2006
    Posts
    26

    [SOLVED]Lookup or SUMIF ??

    fantastic !!

    worked perfectly... much appreciated


+ 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