Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default SUMPRODUCT help needed

I have a spreadsheet with about 1000 rows. In rows M & N there are dates. I
am trying to add in on e step the differences in the dates in column M & N
using the formula
=SUMPRODUCT(--($N$5:$N$1500$M$5:$M$1500),--($M$5:$M$1500<""),($N$5:$N$1500-$M$5:$M$1500))
This gives me a sum of 162,720. However to check the accuracy of the
formula I calculated the added the difference between each row and totaled
the numbers, that gave me an answer of 159,320. If column has a date column
B doesnt necessarily have one and vice versa. Rows with only one date shown
are ignored. Also some rows have no dates. 98% of the time column Nis
greater than column N but there are some entries where N is larger than M.
Im thinking that might be the problem. Its alright if N is larger than M.

--
Robert K
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default SUMPRODUCT help needed

You SUMPRODUCT is only adding numbers where N M. However, when you did a
check, you prb did a straight subtraction of N - M. For the rows where N < M,
this results in a negative number, thus leading to a smaller answer than the
one returned by SUMPRODUCT.

If it doesn't matter if N is bigger than M, remove that arguement from the
SUMPRODUCT function.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"RobertK" wrote:

I have a spreadsheet with about 1000 rows. In rows M & N there are dates. I
am trying to add in on e step the differences in the dates in column M & N
using the formula
=SUMPRODUCT(--($N$5:$N$1500$M$5:$M$1500),--($M$5:$M$1500<""),($N$5:$N$1500-$M$5:$M$1500))
This gives me a sum of 162,720. However to check the accuracy of the
formula I calculated the added the difference between each row and totaled
the numbers, that gave me an answer of 159,320. If column has a date column
B doesnt necessarily have one and vice versa. Rows with only one date shown
are ignored. Also some rows have no dates. 98% of the time column Nis
greater than column N but there are some entries where N is larger than M.
Im thinking that might be the problem. Its alright if N is larger than M.

--
Robert K

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default SUMPRODUCT help needed

This will only subtract M from N if N is greater than M. Look at the
response I gave you the other day on earlies and lates. If you are not
bothered about negative days, then the first term is not needed,
although you might want a term to check that column N is not blank,
like this:

=SUMPRODUCT(--($N$5:$N$1500<""),--($M$5:$M$1500<""),($N$5:$N$150*0-$M
$5:$M$1500))

This should give you the answer you expect.

Hope this helps.

Pete

On Sep 21, 8:05*pm, RobertK wrote:
I have a spreadsheet with about 1000 rows. *In rows M & N there are dates. *I
am trying to add in on e step the differences in the dates in column M & N
using the formula
=SUMPRODUCT(--($N$5:$N$1500$M$5:$M$1500),--($M$5:$M$1500<""),($N$5:$N$150*0-$M$5:$M$1500))
This gives me a sum of 162,720. *However to check the accuracy of the
formula I calculated the added the difference between each row and totaled
the numbers, that gave me an answer of 159,320. *If column has a date column
B doesn’t necessarily have one and vice versa. *Rows with only one date shown
are ignored. *Also some rows have no dates. *98% of the time column Nis
greater than column N but there are some entries where N is larger than M.. *
I’m thinking that might be the problem. *It’s alright if N is larger than M.

--
Robert K


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default SUMPRODUCT help needed

Luke/Pete, thanks that did it.
--
Robert K


"Pete_UK" wrote:

This will only subtract M from N if N is greater than M. Look at the
response I gave you the other day on earlies and lates. If you are not
bothered about negative days, then the first term is not needed,
although you might want a term to check that column N is not blank,
like this:

=SUMPRODUCT(--($N$5:$N$1500<""),--($M$5:$M$1500<""),($N$5:$N$150Â*0-$M
$5:$M$1500))

This should give you the answer you expect.

Hope this helps.

Pete

On Sep 21, 8:05 pm, RobertK wrote:
I have a spreadsheet with about 1000 rows. In rows M & N there are dates. I
am trying to add in on e step the differences in the dates in column M & N
using the formula
=SUMPRODUCT(--($N$5:$N$1500$M$5:$M$1500),--($M$5:$M$1500<""),($N$5:$N$150Â*0-$M$5:$M$1500))
This gives me a sum of 162,720. However to check the accuracy of the
formula I calculated the added the difference between each row and totaled
the numbers, that gave me an answer of 159,320. If column has a date column
B doesnt necessarily have one and vice versa. Rows with only one date shown
are ignored. Also some rows have no dates. 98% of the time column Nis
greater than column N but there are some entries where N is larger than M..
Im thinking that might be the problem. Its alright if N is larger than M.

--
Robert K



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default SUMPRODUCT help needed

You're welcome, Robert - glad to hear it.

Pete

On Sep 21, 10:10*pm, RobertK
wrote:
Luke/Pete, thanks that did it. *
--
Robert K



"Pete_UK" wrote:
This will only subtract M from N if N is greater than M. Look at the
response I gave you the other day on earlies and lates. If you are not
bothered about negative days, then the first term is not needed,
although you might want a term to check that column N is not blank,
like this:


=SUMPRODUCT(--($N$5:$N$1500<""),--($M$5:$M$1500<""),($N$5:$N$150*0-$M
$5:$M$1500))


This should give you the answer you expect.


Hope this helps.


Pete


On Sep 21, 8:05 pm, RobertK wrote:
I have a spreadsheet with about 1000 rows. *In rows M & N there are dates. *I
am trying to add in on e step the differences in the dates in column M & N
using the formula
=SUMPRODUCT(--($N$5:$N$1500$M$5:$M$1500),--($M$5:$M$1500<""),($N$5:$N$150**0-$M$5:$M$1500))
This gives me a sum of 162,720. *However to check the accuracy of the
formula I calculated the added the difference between each row and totaled
the numbers, that gave me an answer of 159,320. *If column has a date column
B doesn’t necessarily have one and vice versa. *Rows with only one date shown
are ignored. *Also some rows have no dates. *98% of the time column Nis
greater than column N but there are some entries where N is larger than M.. *
I’m thinking that might be the problem. *It’s alright if N is larger than M.


--
Robert K- Hide quoted text -


- Show quoted text -




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumproduct help needed. Jonathan[_3_] Excel Discussion (Misc queries) 5 December 10th 07 11:03 PM
Min/Max help needed with a SumProduct JR Excel Worksheet Functions 13 February 13th 06 05:08 PM
Sumproduct Help Needed Timmy Mac1 Excel Discussion (Misc queries) 4 January 26th 06 01:19 PM
SUMPRODUCT help needed bradgrafelman Excel Worksheet Functions 2 June 13th 05 03:49 AM
Sumproduct help needed! Trying to excel in life but need help Excel Worksheet Functions 5 January 21st 05 09:07 PM


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"