+ Reply to Thread
Results 1 to 5 of 5

SUMPRODUCT throwing RunTime Error 13 - Type mismatch

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,394

    SUMPRODUCT throwing RunTime Error 13 - Type mismatch

    SUMPRODUCT Macro on attached using named Ranges generates RUNTIME ERROR 13 - Type Mismatch, and can't see why?

    Need to enter into Col D the match in Q14 - X22 for two criteria - the string in Col D and the month in Q4.

    Col D shows the correct answer using a formula.
    Col E shows the correct answer using VBA but with "hardwired" ranges
    This approach is no use, because the "ranges" will change each month.

    Col F should show the answer using the Named Ranges, but it generates a RUNTIME error.

    I have also tried approaching this with VBA Index Match and SUMIFS, but none delivered the answer.

    Any solutions, suggestions or alternatives are welcome.

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 10-03-2018 at 05:12 PM.

  2. #2
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: SUMPRODUCT throwing RunTime Error 13 - Type mismatch

    I think your two VBA formulas should be:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: SUMPRODUCT throwing RunTime Error 13 - Type mismatch

    Also, not sure why you used "b - 1" to get the value for MATCHrng and VALUErng. Get rid of the merged cell and text that occurs in Q23:X23, and just use the variable b. You can then use the variable b in the first formula for Offset(0, 1). Full new code:
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,394

    Re: SUMPRODUCT throwing RunTime Error 13 - Type mismatch

    Many thanks for prompt corrections. After twenty years using Excel I really should have realised the omissions!

    I added the merged cells for each range simply to make the structure crystal clear, after various people said in the past they found it difficult to follow the sequences.

    And "selection.offset(1,0)" was added to omit the Headers for the ranges, and "b-1" to omit the Total lines.

    Happily, can now mark this as "Solved"

    Ochimus

  5. #5
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: SUMPRODUCT throwing RunTime Error 13 - Type mismatch

    Glad I could help!

+ 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. Runtime Error 13 Type Mismatch
    By peakoverload in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-16-2018, 10:34 AM
  2. [SOLVED] Runtime error 13 Type mismatch
    By logisticsexcel in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-31-2017, 02:43 PM
  3. Type mismatch runtime error 13
    By kalyanr12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2014, 04:09 PM
  4. Runtime Error Type Mismatch
    By hungryhobo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-08-2013, 08:50 PM
  5. [SOLVED] Runtime Error '13' Type Mismatch
    By Rayneill in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-08-2013, 01:03 AM
  6. runtime error '13' type mismatch
    By longhorn23 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-18-2010, 04:53 PM
  7. [SOLVED] Runtime Error Type 13 Mismatch
    By Linking to specific cells in pivot table in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2006, 12:35 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