+ Reply to Thread
Results 1 to 3 of 3

Formula returning value error

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-24-2009
    Location
    london
    MS-Off Ver
    Excel 2013
    Posts
    129

    Formula returning value error

    this is really beating me up so if someone could help me out that would be awesome.
    I am using this formula:
    SUMPRODUCT(INDIRECT("'BBO Count'!B"&MATCH($A4,'BBO Count'!$B:$B,0)&":J"&MATCH($A4,'BBO Count'!$B:$B,0)),--(MONTH('BBO Count'!$B$3:$J$3)=MONTH(B$3)))
    I have added columns to my sheet and when I change the string (highlighted red) it then returns a "Value Error". anyone have any idea why?

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula returning value error

    You would get #VALUE! if

    a) any value in 'BBO Count'!B3:J3 was not a valid date (number) as MONTH explicitly coerces (same holds true for B3 on calculation sheet obviously) - this would include formula Null Strings

    b) any precedent cells contain underlying #VALUE! errors.

    If we assume the values in 'BBO Count'!B3:J3 vary by day (thereby necessitating the month test) and no underlying errors we can remove the coercion issue by using a TEXT construct...

    =SUMPRODUCT(--(TEXT('BBO Count'!$B$3:$J$3,"mmm")=TEXT(B$3,"mmm")),INDEX('BBO Count'!$B:$J,MATCH($A4,'BBO Count'!$B:$B,0),0))
    If we were only concerned with Null Strings in the Date Header range we could omit the TEXT and use a 0& prefix:

    =SUMPRODUCT(--(MONTH(0&'BBO Count'!$B$3:$J$3)=MONTH(B$3)),INDEX('BBO Count'!$B:$J,MATCH($A4,'BBO Count'!$B:$B,0),0))
    the TEXT approach is more flexible.

    note: INDIRECT is not necessary given INDEX (this also reduces the Volatility of the function)

    XL2007+ we would use SUMIFS rather than SUMPRODUCT for this calculation.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula returning value error

    keith6292,

    this question closely resembles that of your other thread

    If as implied by the sample on that thread you are indeed using XL2007 or above then you should proceed with SUMIFS in preference to SUMPRODUCT given the formers significant efficiency when compared to the latter. If you require backwards compatibility then obviously SUMIFS is not viable.

+ 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