Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2017, 05:22 AM
OTPM OTPM is offline Help with a SUMPRODUCT Formula Windows 10 Help with a SUMPRODUCT Formula Office 2016
Expert
Help with a SUMPRODUCT Formula
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default Help with a SUMPRODUCT Formula

Hi
I need some help with a formula. For example I need to calculate the number of working days in May 2016 within the data shown below. I have a formula which is not giving me the correct answer. The answer should be 64 days. Sample file is attached for reference. The formula I need help with is:

=SUMPRODUCT(--(MONTH($F$1)&"|"&YEAR($F$1)=MONTH(Sheet1!$E$6:$E$4 000)&"|"&YEAR(Sheet1!$E$6:$E$4000)),--($A5=Sheet1!$A$6:$A$4000),Sheet1!$I$6:$I$4000)

Col A ......................Col E......Col F
BUSINESS SUPPORT 23/05/16 03/06/16
BUSINESS SUPPORT 23/05/16 03/06/16
BUSINESS SUPPORT 23/05/16 03/06/16
BUSINESS SUPPORT 23/05/16 03/06/16
BUSINESS SUPPORT 23/05/16 03/06/16
BUSINESS SUPPORT 23/05/16 03/06/16
BUSINESS SUPPORT 25/04/16 22/06/16
BUSINESS SUPPORT 25/07/16 25/07/16

Any help would be appreciated.

Kind regards

Tony
Reply With Quote
  #2  
Old 05-11-2017, 06:01 AM
NBVC's Avatar
NBVC NBVC is offline Help with a SUMPRODUCT Formula Windows 7 64bit Help with a SUMPRODUCT Formula Office 2007
The Formula Guy
 
Join Date: Mar 2012
Location: Mississauga, CANADA
Posts: 215
NBVC will become famous soon enoughNBVC will become famous soon enough
Default

Can you explain how you would get a result of 64 with the sample you provided in your workbook?
Reply With Quote
  #3  
Old 05-11-2017, 06:37 AM
OTPM OTPM is offline Help with a SUMPRODUCT Formula Windows 10 Help with a SUMPRODUCT Formula Office 2016
Expert
Help with a SUMPRODUCT Formula
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Quote:
Originally Posted by NBVC View Post
Can you explain how you would get a result of 64 with the sample you provided in your workbook?
Hi
I have just checked the figures for working days for May 17 should be:
13 Apr 16 to 19 May 17 = 15 days
9 Feb 16 to 18 May 17 = 14 days
2 Aug 16 - 15 May 17 = 11 days
22 May 17 to 24 May 17 = 3 days
23 May 16 to 23 May 17 = 17 days
10 Feb 17 to 9 Jun 17 = 23 days
22 May 17 to 26 May 17 = 5 days
29 May 17 - 2 Jun 17 = 3 days
29 May 17 to 2 Jun 17 = 3 days
Totalling: 94 days - sorry for the error.

Thanks

Tony
Reply With Quote
  #4  
Old 05-11-2017, 06:43 AM
NBVC's Avatar
NBVC NBVC is offline Help with a SUMPRODUCT Formula Windows 7 64bit Help with a SUMPRODUCT Formula Office 2007
The Formula Guy
 
Join Date: Mar 2012
Location: Mississauga, CANADA
Posts: 215
NBVC will become famous soon enoughNBVC will become famous soon enough
Default

I don't see any of those dates in your sample file. I am trying to figure out why your formula is not working (to me it seems correct based on the logic I am assuming you are looking for) but I can't determine that if I don't match your expected results to your formula output.
Reply With Quote
  #5  
Old 05-11-2017, 07:03 AM
OTPM OTPM is offline Help with a SUMPRODUCT Formula Windows 10 Help with a SUMPRODUCT Formula Office 2016
Expert
Help with a SUMPRODUCT Formula
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
Have a look at a revised sample attached.

Thanks for looking at my issue/challenge.

Ignore then entries in B1:C1.

Tony
Attached Files
File Type: xlsx Sumproduct Challenge.xlsx (12.0 KB, 15 views)
Reply With Quote
  #6  
Old 05-11-2017, 07:17 AM
NBVC's Avatar
NBVC NBVC is offline Help with a SUMPRODUCT Formula Windows 7 64bit Help with a SUMPRODUCT Formula Office 2007
The Formula Guy
 
Join Date: Mar 2012
Location: Mississauga, CANADA
Posts: 215
NBVC will become famous soon enoughNBVC will become famous soon enough
Default

The thing is that if those entries were in your original sheet, I think your formula (that you already have there) would give you the correct result. Unless the setup of your workbook is not like your original sample.

I am confused as to why you think that the formula is wrong.
Reply With Quote
  #7  
Old 05-11-2017, 07:26 AM
OTPM OTPM is offline Help with a SUMPRODUCT Formula Windows 10 Help with a SUMPRODUCT Formula Office 2016
Expert
Help with a SUMPRODUCT Formula
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
The NETWORKDAYS formula in the Sumproduct Challenges workbook only works for a single row. I need it to work for a range. For example I need the number of working days in May 2017 where the row in Column A = "Business Support". That's the bit I am struggling with.
Thanks
Tony
Reply With Quote
  #8  
Old 05-11-2017, 08:38 AM
NBVC's Avatar
NBVC NBVC is offline Help with a SUMPRODUCT Formula Windows 7 64bit Help with a SUMPRODUCT Formula Office 2007
The Formula Guy
 
Join Date: Mar 2012
Location: Mississauga, CANADA
Posts: 215
NBVC will become famous soon enoughNBVC will become famous soon enough
Default

Why not use the calculated values in column D as you did in your original formula?
Reply With Quote
  #9  
Old 05-15-2017, 01:36 AM
OTPM OTPM is offline Help with a SUMPRODUCT Formula Windows 10 Help with a SUMPRODUCT Formula Office 2016
Expert
Help with a SUMPRODUCT Formula
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
The solution needs to cover a range of dates, not just May. My approach was that if I had the solution for May I could use the same formula for other months.
For example I will have a range of dates from Feb 16 to Dec 17 and I need to calculate the number of days within each date range for each month.
Hope this makes sense.
Thanks
Tony
Reply With Quote
  #10  
Old 05-15-2017, 08:03 AM
NBVC's Avatar
NBVC NBVC is offline Help with a SUMPRODUCT Formula Windows 7 64bit Help with a SUMPRODUCT Formula Office 2007
The Formula Guy
 
Join Date: Mar 2012
Location: Mississauga, CANADA
Posts: 215
NBVC will become famous soon enoughNBVC will become famous soon enough
Default

Does this array formula work?

=SUM((NETWORKDAYS(IF(D1>$B$3:$B$11,D1,B3:B11),IF(E OMONTH(D1,0)<C3:C11,EOMONTH(D1,0),$C$3:$C$11))))

Confirmed with CTRL+SHIFT+ENTER not just ENTER
Reply With Quote
  #11  
Old 05-16-2017, 01:17 AM
OTPM OTPM is offline Help with a SUMPRODUCT Formula Windows 10 Help with a SUMPRODUCT Formula Office 2016
Expert
Help with a SUMPRODUCT Formula
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
Your suggested formula does not take into account the skillset in Column A which I need it to.
Thanks for your help so far.
It is really appreciated.
Kind regards
Tony
Reply With Quote
  #12  
Old 05-16-2017, 05:01 AM
NBVC's Avatar
NBVC NBVC is offline Help with a SUMPRODUCT Formula Windows 7 64bit Help with a SUMPRODUCT Formula Office 2007
The Formula Guy
 
Join Date: Mar 2012
Location: Mississauga, CANADA
Posts: 215
NBVC will become famous soon enoughNBVC will become famous soon enough
Default

Sorry about that... try:

Code:
=SUM(IF($A$3:$A$11="Business Support",(NETWORKDAYS(IF($D$1>$B$3:$B$11,$D$1,$B$3:$B$11),IF(EOMONTH($D$1,0)<$C$3:$C$11,EOMONTH($D$1,0),$C$3:$C$11))),0))
Confirmed with CTRL+SHIFT+ENTER

You can replace "Business Support" with a reference cell containing that text string...
Reply With Quote
  #13  
Old 05-17-2017, 04:04 AM
OTPM OTPM is offline Help with a SUMPRODUCT Formula Windows 10 Help with a SUMPRODUCT Formula Office 2016
Expert
Help with a SUMPRODUCT Formula
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
Works perfectly.
Many thanks for your help.
Kind regards
Tony
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with SumProduct Perceptus Excel 1 03-13-2015 06:23 AM
sumproduct?? jer Excel 9 10-14-2012 10:00 AM
Help with a SUMPRODUCT Formula Sumproduct formula Portucale Excel 2 09-12-2012 10:51 AM
Help with a SUMPRODUCT Formula Sumproduct angie.chang Excel 3 06-14-2012 10:00 AM
Help with a SUMPRODUCT Formula sumproduct formula to pull info from multiple sheets Berk21 Excel 7 01-15-2012 11:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft