Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This was the ONLY place that I could find information that I could use to resolve the problem. So thanks once again to member TomSark and the SQL forum!..."

Geography

Where in the world do Tek-Tips members come from?

Sumproduct or Something faster/betterHelpful Member! 

Gavona (TechnicalUser)
3 May 12 12:55
I have a large Excel Table.  I am working in xl2007 but solution must work in 2003.  I want to identify the records where a "document_number" relates to more than one "Service".
My current formula is based on sumproduct which, with 60,000 rows, not suprisingly takes too long.  Is there a better solution?  I am adding to the bottom of the table each month and the values in "Service" may change for all records.

I can't post the precise formula as the vba that applies it is still doing its work :(  However it is of the form:

=sumproduct(--(document_number=Thisdocument_number),--(Service<>=ThisService))>0

All ideas welcomed!

Gavin

SkipVought (Programmer)
3 May 12 13:09


hi,

Why not use MS Query?

CODE

select document_number, count(*)
From
(
select DISTINCT document_number, Service
from [YourSheetName$]
)
group by document_number
having count(*) > 1
 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Gavona (TechnicalUser)
3 May 12 13:14
Probably just because I haven't used query successfully much tbh.  I'll give that a try - it could have other benefits with this report too.

Maybe getting ahead of myself but I can use the result set from that as the source for a pivot can't I?

 

Gavin

SkipVought (Programmer)
3 May 12 13:24



Yes, because it's just a table.  However, it is already a summary of your original table, which is what a PT is.

You could take the SQL back one step and return the data for this...

CODE

select DISTINCT document_number, Service
from [YourSheetName$]
Then a PT of the resultset might make sense.
 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

SkipVought (Programmer)
3 May 12 13:31


And why could you not pivot on the source data and eliminate the query step?

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Gavona (TechnicalUser)
3 May 12 13:32
Thanks Skip - sound like something to get my teeth into on Tuesday when I am next in the office.  I'll try not to come back with too many questions but any pointers to examples/good sites might speed me on my way.

Thanks again.

Gavin

Gavin

Helpful Member!  SkipVought (Programmer)
3 May 12 13:37


In fact, you can SORT the document_number PT field DESCENDING by the Count of document_number, and you get a pareto of occurrences.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close