+ Reply to Thread
Results 1 to 7 of 7

DATEVALUE for an array

  1. #1
    Registered User
    Join Date
    09-16-2017
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    24

    DATEVALUE for an array

    Hi All,

    I'm looking to perform a SUMPRODUCT based upon the number of weeks passed. However the week column is in the form of a string (WE - 15/06/2019). So I'm looking Sum weeks inc. last weeks using an array but the DATEVALUE and array part is causing an issue = #VALUE!

    Please Login or Register  to view this content.
    Any tips appreciated

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: DATEVALUE for an array

    I'd recommend uploading sample workbook with desensitized sample of your data and expected result.

    As well, text manipulation of string date can be tricky. What may work in one system may not work in another.

    For an example, your formula should work for UK based system (system date format set to dd/mm/yyyy), but won't for US based system (mm/dd/yyyy).

    Best practice is to store date as date value and use formatting to display.

    If that's not feasible, another alternative is to use helper column. It will often be easier to maintain, and will speed up calculation process.

    To attach workbook. Use "Go Advanced" and follow "Manage Attachments" hyperlink. It will launch new tab/window for managing uploads.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: DATEVALUE for an array

    Maybe try just adding a helper column to extract the datevalue or week num, then using that in the calc?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: DATEVALUE for an array

    Hi,

    You must have some entries in the WEEK column which return an error when passed to DATEVALUE. Any blank cells, for example, would do just that.

    If it's not blanks which are the issue, I suggest you temporarily add an additional column to your data table which uses the same =DATEVALUE(RIGHT(...,10) formula on each of the entries in the WEEK column to see which is giving an error.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: DATEVALUE for an array

    I'd also say that if the text formatting of the dates (i.e. 00/00/0000) is the same you probably don't need to coerce the values (via DATEVALUE).

    =SUMPRODUCT((LEFT(BUDEPT,4)=LEFT(B11,4))*(PLAN="RF")*(METRIC="FP&P Sls Val")*(RIGHT(WEEK,10)<=(RIGHT(C4,10)))*(DATA))/1000

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: DATEVALUE for an array

    Quote Originally Posted by XLent View Post
    I'd also say that if the text formatting of the dates (i.e. 00/00/0000) is the same you probably don't need to coerce the values (via DATEVALUE).
    Your "probably" suggested you had doubts!

    Unlike e.g. COUNTIF, SUMPRODUCT does not implicitly treat text strings representing dates as actual dates.

    So, for example, your construction will mistakingly consider 01/11/2019 to be 'less than or equal' to 03/10/2018, since it is employing a straightforward text-to-text comparison.

    Regards

  7. #7
    Registered User
    Join Date
    09-16-2017
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    24

    Re: DATEVALUE for an array

    Thanks all for your suggestions. In end, just to get the thing done, I've just done a helper column with an IF statement and then added when Helper column = "PAST" into the SUMPRODUCT.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Datevalue
    By juan.doe in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-03-2016, 10:49 AM
  2. Something other than DATEVALUE
    By edwardpestian in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-09-2006, 12:05 AM
  3. datevalue
    By LarryTheK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. datevalue
    By LarryTheK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. [SOLVED] datevalue
    By Govind in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 04:05 AM
  6. [SOLVED] datevalue
    By LarryTheK in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  7. datevalue
    By LarryTheK in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-22-2005, 10:24 PM

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