Results 1 to 5 of 5

Use SUMPRODUCT, LEFT, and YEAR functions together

Threaded View

  1. #1
    Registered User
    Join Date
    10-22-2020
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    2020
    Posts
    2

    Use SUMPRODUCT, LEFT, and YEAR functions together

    Hello everyone!

    I would like use the SUMPRODUCT, LEFT, and the YEAR functions simultaneously. Column D contains data in the format '2017/01' (yyyy/mm), column E contains the amounts in $ that I would like to add together. Cell C2 contains the date in format 'dd/mm/yyyy'. I would like to have a function that adds the values in E if the year(C2) = left(D:D,4) and if month(C2) = right(D:D, 2)

    I wrote this function but unfortunately Excel returns 0: =SUMPRODUCT(--(LEFT(D:D,4)=YEAR(C2)), --(RIGHT(D:D,2)=MONTH(C2)),E:E). If I remove the YEAR/MONTH functions, the formula, which becomes =SUMPRODUCT(--(LEFT(D:D,4)=C2), --(RIGHT(D:D,2)=C2),E:E) works correctly. So, apparently the MONTH/YEAR functions are causing the error.

    Do you have any suggestion on how I could make the formula work?

    Thanks a lot in advance
    Attached Files Attached Files
    Last edited by excelmagic20; 10-22-2020 at 08:22 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Days left before end of contract year
    By thursday140 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2019, 09:13 AM
  2. [SOLVED] sumproduct to count year values in range based on another cell year value
    By mr_mango81 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-04-2017, 12:46 AM
  3. Time left in policy year
    By bryandecker in forum Excel Formulas & Functions
    Replies: 30
    Last Post: 03-22-2017, 04:09 PM
  4. [SOLVED] LEFT and SUMPRODUCT functions combined
    By DeZeeuw2 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-27-2014, 11:36 AM
  5. [SOLVED] Average a number into months left in year
    By jgryctz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-14-2013, 02:50 PM
  6. Numbers of days left till the end of the year
    By Harrold in forum Excel General
    Replies: 2
    Last Post: 11-15-2011, 02:06 AM
  7. LEFT and RIGHT functions
    By shanemjo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-11-2005, 08:30 AM

Tags for this Thread

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