+ Reply to Thread
Results 1 to 15 of 15

Multiple date based SUMPRODUCT failing

Hybrid View

smninos Multiple date based... 11-18-2009, 03:13 PM
teylyn Re: Multiple date based... 11-18-2009, 03:35 PM
WHER Re: Multiple date based... 11-18-2009, 03:58 PM
Lotus123 Re: Multiple date based... 11-18-2009, 04:54 PM
smninos Re: Multiple date based... 11-18-2009, 05:06 PM
smninos Re: Multiple date based... 11-18-2009, 05:11 PM
DonkeyOte Re: Multiple date based... 11-18-2009, 05:18 PM
smninos Re: Multiple date based... 11-20-2009, 01:50 PM
DonkeyOte Re: Multiple date based... 11-20-2009, 02:46 PM
smninos Re: Multiple date based... 11-20-2009, 03:15 PM
DonkeyOte Re: Multiple date based... 11-20-2009, 03:32 PM
smninos Re: Multiple date based... 11-24-2009, 10:54 AM
DonkeyOte Re: Multiple date based... 11-24-2009, 01:54 PM
smninos Re: Multiple date based... 11-24-2009, 02:22 PM
DonkeyOte Re: Multiple date based... 11-24-2009, 02:30 PM
  1. #1
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Multiple date based SUMPRODUCT failing

    I have the the need to show the sum of the product of sheet 2 on sheet 1 if several conditions are met.

    The formula is working except for the first array:

    =SUMPRODUCT(--(Bid_Circuits=$A2),--(Bid_Week_End=MONTH(D2)),--(Bid_Week_End=YEAR(D2)),--(Bid_Completed))

    When I use XL's evaluate feature, XL seems to find the proper data yet returns #VALUE!

    I have no idea where to go from here & I would greatly appriciate any help.
    Attached Files Attached Files
    Last edited by smninos; 12-03-2009 at 10:14 AM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Multiple date based SUMPRODUCT failing

    Without looking at your worksheet (too big! - could you upload a smaller sample?):

    Whatever data type is in A2 needs to be in Bid_Circuits, too.
    Check if numbers are entered/stored as text and convert them to numbers.

  3. #3
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Multiple date based SUMPRODUCT failing

    I think one of your named ranges (Bid_Completed) contains one more row than the other two, due to the presence of a number in cell F2 (Sheet2) while D2 is empty and E2 contains a string?

  4. #4
    Forum Contributor Lotus123's Avatar
    Join Date
    11-07-2005
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    153

    Re: Multiple date based SUMPRODUCT failing

    Change the defined name for bid_completed to the following:

    =OFFSET('SHEET 2'!$F$4,0,0,COUNT('SHEET 2'!$D:$D),1)

    Your spreadsheet won't have any #VALUE errors after that change.
    Ecce Potestas Casei
    Nathan Head

  5. #5
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Re: Multiple date based SUMPRODUCT failing

    I made sure the cells were formatted the same in both sheets, nothing changed. I looked at the rows in the ranges and they all appeared to be the same to me. Although, when I deleted a line above where the ranges began, the result changed from #VALUE! to 0.0. Close but not quite there.

    I have uploaded a smaller sample as requested.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Re: Multiple date based SUMPRODUCT failing

    I made the change Lotus123 suggested and that did solve the #VALUE! error but the formula is still resulting in 0.0. ????

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

    Re: Multiple date based SUMPRODUCT failing

    If you wish to compare MONTH values you must coerce the named range to MONTH also.

    =SUMPRODUCT(--(Bid_Circuits=$A2),--(MONTH(Bid_Week_End)=MONTH(D2)),--(YEAR(Bid_Week_End)=YEAR(D2)),Bid_Completed)
    You could also use

    =SUMPRODUCT(--(Bid_Circuits=$A2),--(Bid_Week_End-DAY(Bid_Week_End)+1=D2-DAY(D2)+1),Bid_Completed)

  8. #8
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Re: Multiple date based SUMPRODUCT failing

    Donkeyote, your solution seems to have solved that issue but now:

    Eveything seems to work as intended in the sample spreadsheet but when I add additonal data to the second sheet, all formulas result in #N/A & #VALUE!. I think it may have something to do with the named ranges but I really don't know much about dynamic ranges.

    My original "Sheet 2" has over 1500 lines of data. I can add upto 500 and the formulas on sheet 1 give the results as expected. It's when data exceeds between 500 & 900 that the formulas result in errors.

    Thanks for all your help. I really do appreciate it.

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

    Re: Multiple date based SUMPRODUCT failing

    We'd need to see the file or at least the RefersTo element of the named ranges.

    #VALUE! errors in a double unary can arise from inconsistent array dimensions but underlying error values can also generate errors... in this case it sounds like a case of the former but it's still just an educated guess.

  10. #10
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Re: Multiple date based SUMPRODUCT failing

    =OFFSET('Bid Mileage'!$C$4,0,0,COUNT('Bid Mileage'!$C:$C),1)
    =OFFSET('Bid Mileage'!$D$4,0,0,COUNT('Bid Mileage'!$B:$B),1)
    =OFFSET('Bid Mileage'!$B$4,0,0,COUNT('Bid Mileage'!$B:$B),1)

    I also wonder how could the formulas be re-written to speed up the calculations in the 2.5 YEAR TRIM CYCLE workbook. The layout should remain the same allowing the user to filter and sort the circuits.
    Attached Files Attached Files
    Last edited by smninos; 11-20-2009 at 03:23 PM.

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

    Re: Multiple date based SUMPRODUCT failing

    Change Bid_Circuits to use $B:$B as opposed to $C:$C ... column C has two blanks in it which means the ranges are not the same size, use B for all ranges.

    The above is the quickest fix based on what you have setup presently.

  12. #12
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Re: Multiple date based SUMPRODUCT failing

    Donkeyote, you've been a life saver upto now... I hope you can help once more my friend.

    I made the last change you suggested and everything was working fine. Then I discovered that nothing works unless both workbooks are open. Can you take a look at those last two books I uploaded to see what the issue may be? Is there a work around?

    Thanks to all of you that have helped me!!

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

    Re: Multiple date based SUMPRODUCT failing

    You won't be able to use your Dynamic Named Ranges if the target file is to be closed, you will need to explicitly define them... eg: instead of Bid_Week_End you would need to use say $B$4:$B$2000 (rept for other names and in all formulae).

    EDIT: I should add that the above is based on my assumptions and is not meant as a statement of fact
    Last edited by DonkeyOte; 11-24-2009 at 01:58 PM.

  14. #14
    Registered User
    Join Date
    07-29-2008
    Location
    FL
    MS-Off Ver
    XL 2007 & 2008
    Posts
    27

    Re: Multiple date based SUMPRODUCT failing

    Thanks Donkeyote....

    What performance impact will this have? I notice that the workbooks are already much slower than I'd like due to the arrays. I am considering database functions but have some learning to do first.

    Can you see dfunctions as a viable alternative with the setup I currently have?

    Many thanks Donkeyote!

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

    Re: Multiple date based SUMPRODUCT failing

    It depends on how much data you're adding - ie how much excess capacity you would need to add in to your fixed ranges to account for future data... if you're talking a few hundred rows of excess then it won't make a huge difference IMO and there are overheads with Dynamic Named Ranges anyway so the cost will to some extent be offset by their removal.

    As for alternatives... well I'm afraid I'm not a fan of external links ... I'm a firm believer in keeping files independent from one another in a "live" sense.
    If you need data from file 2 for calculations in file 1 it is IMO best to store it in file 1, if that means copy/paste from one file to another so be it - that process can always be automated via VBA (Mac 2008 excepted!).

    Others argue the above is risky given you're not necessarily working with "latest data" etc and as such prefer to link but as you've discovered that brings with it it's own limitations. Others use ADO, external data queries etc

    I've always believed in being able to save a network file locally, hop onto a plane and work on the file seamlessly before uploading said file back to the network upon arrival... linked files generally speaking (and I say generally) prevent that kind of thing or at best make it a "faff".

+ 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