Consulting

Results 1 to 3 of 3

Thread: Sum a shifting range

  1. #1
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location

    Sum a shifting range

    Hi

    I have a tricky conundrum. No, really.

    On the attached sheet I work out a "Transfer Percentage" by dividing the number of (telephone) transfers by the number of calls. Easy Peasy.

    I also need to work out a 4 week average based on a date the user selects.

    So if the user selects "18-Feb" the four week average will be worked out as follows:

    The sum of Transfers from 28-Jan to 18-Feb
    divided by
    The sum of Calls from 28-Jan to 18-Feb

    Working that out is easy too - except I need the sum range to be dynamic based on the date the user select in cell D2 on the Trans% sheet.

    I think I need an Offset() - but how can I do this please?

    Sir BD
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Array formula

    =SUM(IF(($D4:$V4>$D$2-28)*($D4:$V4<=D2)*(Calls!$D5:$V5<>""),Transfers!$D5:$V5))/
    SUM(IF(($D4:$V4>$D$2-28)*($D4:$V4<=D2)*(Calls!$D5:$V5<>""),Calls!$D5:$V5))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location
    That's poifect

    Thanks XLD

    BD
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •