+ Reply to Thread
Results 1 to 3 of 3

Sumif with variable target

  1. #1
    Forum Contributor
    Join Date
    07-11-2005
    Posts
    110

    Sumif with variable target

    Column A has over a hundred different parts codes. The order of codes in this can change from month to month.

    Column C is a list of all the parts codes from all invoices in Janaury with their sales value in Column D. These columns are a couple of thousand lines long. Columns E through Z contain the rest of the months of the year, with a list of parts codes off the invoices in the respective months and their values.

    If I want to find out the totals for the codes in say January I use a sumif formula in column B. But if I want to find out the totals for March I have to re-wrtie the formula. Is it possible to have the formula look up the values from a month declared in cell A1?

    Thanks for any ideas.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Presumably you have a formula currently in B2 something like

    =SUMIF(C$2:C$2000,A2,D$2:D$2000)

    assuming you have a date in A1 (i.e. for March 01/03/2006, format as required, e.g. mmmm) then you could use this formula in B2 copied down column

    =SUMIF(INDEX(C$2:Y$2000,0,MONTH(A$1)*2-1),A2,INDEX(D$2:Z$2,MONTH(A$1)*2-1))

  3. #3
    Forum Contributor
    Join Date
    07-11-2005
    Posts
    110
    Thanks a lot - your help's 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