+ Reply to Thread
Results 1 to 7 of 7

SUMIF function

  1. #1
    Pieman
    Guest

    SUMIF function

    Hi, please help...

    I am trying to total up commission figures in a column that match a specific
    year. Each row contains a cell for the date it was entered, the customer
    details and commission earnt.

    I have used the SUMIF funtion so far but cannot find the correct criteria
    for it to identify the year in the date cell and include the commission in
    the SUM if the year matches the criteria.

    The formula I have used so far is: =SUMIF(Websites!B5:B31,F2,Websites!R5:R31).

    F2 refers to a cell with the current year automatically entered by using the
    TEXT function: =TEXT(TODAY(),"yyyy").

    If anyone knows how to achieve this I would be eternally grateful.

    Thanks
    Simon


  2. #2
    Jim Thomlinson
    Guest

    RE: SUMIF function

    =SUMPRODUCT((YEAR(B5:B31) =YEAR(TODAY())) * M5:M31)

    Look at this web site for more info...

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html
    --
    HTH...

    Jim Thomlinson


    "Pieman" wrote:

    > Hi, please help...
    >
    > I am trying to total up commission figures in a column that match a specific
    > year. Each row contains a cell for the date it was entered, the customer
    > details and commission earnt.
    >
    > I have used the SUMIF funtion so far but cannot find the correct criteria
    > for it to identify the year in the date cell and include the commission in
    > the SUM if the year matches the criteria.
    >
    > The formula I have used so far is: =SUMIF(Websites!B5:B31,F2,Websites!R5:R31).
    >
    > F2 refers to a cell with the current year automatically entered by using the
    > TEXT function: =TEXT(TODAY(),"yyyy").
    >
    > If anyone knows how to achieve this I would be eternally grateful.
    >
    > Thanks
    > Simon
    >


  3. #3
    Jim Thomlinson
    Guest

    RE: SUMIF function

    Sorry should be =SUMPRODUCT((YEAR(B5:B31) =YEAR(TODAY())) * R5:R31)
    --
    HTH...

    Jim Thomlinson


    "Jim Thomlinson" wrote:

    > =SUMPRODUCT((YEAR(B5:B31) =YEAR(TODAY())) * M5:M31)
    >
    > Look at this web site for more info...
    >
    > http://www.xldynamic.com/source/xld.SUMPRODUCT.html
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Pieman" wrote:
    >
    > > Hi, please help...
    > >
    > > I am trying to total up commission figures in a column that match a specific
    > > year. Each row contains a cell for the date it was entered, the customer
    > > details and commission earnt.
    > >
    > > I have used the SUMIF funtion so far but cannot find the correct criteria
    > > for it to identify the year in the date cell and include the commission in
    > > the SUM if the year matches the criteria.
    > >
    > > The formula I have used so far is: =SUMIF(Websites!B5:B31,F2,Websites!R5:R31).
    > >
    > > F2 refers to a cell with the current year automatically entered by using the
    > > TEXT function: =TEXT(TODAY(),"yyyy").
    > >
    > > If anyone knows how to achieve this I would be eternally grateful.
    > >
    > > Thanks
    > > Simon
    > >


  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,792
    You could use SUMIF like this

    =SUMIF(Websites!B5:B31,">"&DATE(YEAR(NOW()),1,0),Websites!R5:R31)-SUMIF(Websites!B5:B31,">"&DATE(YEAR(NOW())+1,1,0),Websites!R5:R31).

  5. #5
    Pieman
    Guest

    RE: SUMIF function

    Jim, thats great, thank you very much for your help. Do you know how I could
    achieve the same result but looking for entries for the previous year instead
    of the current one?

    Thanks again

    "Jim Thomlinson" wrote:

    > Sorry should be =SUMPRODUCT((YEAR(B5:B31) =YEAR(TODAY())) * R5:R31)
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Jim Thomlinson" wrote:
    >
    > > =SUMPRODUCT((YEAR(B5:B31) =YEAR(TODAY())) * M5:M31)
    > >
    > > Look at this web site for more info...
    > >
    > > http://www.xldynamic.com/source/xld.SUMPRODUCT.html
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "Pieman" wrote:
    > >
    > > > Hi, please help...
    > > >
    > > > I am trying to total up commission figures in a column that match a specific
    > > > year. Each row contains a cell for the date it was entered, the customer
    > > > details and commission earnt.
    > > >
    > > > I have used the SUMIF funtion so far but cannot find the correct criteria
    > > > for it to identify the year in the date cell and include the commission in
    > > > the SUM if the year matches the criteria.
    > > >
    > > > The formula I have used so far is: =SUMIF(Websites!B5:B31,F2,Websites!R5:R31).
    > > >
    > > > F2 refers to a cell with the current year automatically entered by using the
    > > > TEXT function: =TEXT(TODAY(),"yyyy").
    > > >
    > > > If anyone knows how to achieve this I would be eternally grateful.
    > > >
    > > > Thanks
    > > > Simon
    > > >


  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,792
    That would be

    =SUMPRODUCT((YEAR(B5:B31) =YEAR(TODAY())-1) * R5:R31)

  7. #7
    Jim Thomlinson
    Guest

    RE: SUMIF function

    You should consider using a pivot table. You can group on the date column by
    year
    , month, quarter... Whatever floats your boat. If you have any questions
    about doing this post a new thread and we can work on it...
    --
    HTH...

    Jim Thomlinson


    "Pieman" wrote:

    > Jim, thats great, thank you very much for your help. Do you know how I could
    > achieve the same result but looking for entries for the previous year instead
    > of the current one?
    >
    > Thanks again
    >
    > "Jim Thomlinson" wrote:
    >
    > > Sorry should be =SUMPRODUCT((YEAR(B5:B31) =YEAR(TODAY())) * R5:R31)
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "Jim Thomlinson" wrote:
    > >
    > > > =SUMPRODUCT((YEAR(B5:B31) =YEAR(TODAY())) * M5:M31)
    > > >
    > > > Look at this web site for more info...
    > > >
    > > > http://www.xldynamic.com/source/xld.SUMPRODUCT.html
    > > > --
    > > > HTH...
    > > >
    > > > Jim Thomlinson
    > > >
    > > >
    > > > "Pieman" wrote:
    > > >
    > > > > Hi, please help...
    > > > >
    > > > > I am trying to total up commission figures in a column that match a specific
    > > > > year. Each row contains a cell for the date it was entered, the customer
    > > > > details and commission earnt.
    > > > >
    > > > > I have used the SUMIF funtion so far but cannot find the correct criteria
    > > > > for it to identify the year in the date cell and include the commission in
    > > > > the SUM if the year matches the criteria.
    > > > >
    > > > > The formula I have used so far is: =SUMIF(Websites!B5:B31,F2,Websites!R5:R31).
    > > > >
    > > > > F2 refers to a cell with the current year automatically entered by using the
    > > > > TEXT function: =TEXT(TODAY(),"yyyy").
    > > > >
    > > > > If anyone knows how to achieve this I would be eternally grateful.
    > > > >
    > > > > Thanks
    > > > > Simon
    > > > >


+ 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