sorting and summing large

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Sorting and summing large amounts of data | Excel forum

Sorting and summing large amounts of data | Excel forum

resolvedResolved · Medium Priority · Version 2007

Tracey has attended:
Excel VBA Intro Intermediate course

Sorting and summing large amounts of data

I have a data download from a .sql database to Excel. I have written code to refresh this, and it populates an Excel worksheet. I need to sum this data so that drivers (eg alpha-numeric nominal codes) appear once, and another column is summed if a third column meets certain criteria.

Eg - I may have 25 transactions appearing for nominal code 1234abc, 36 transactions for nominal code 4567def.

I want 1234 in one column, abc in another column, 4567 in the first column a row below 1234 and def in the second column a row below abc. I then want to sum whichever of the 25 transactions (column f - column g in my base data sheet) for 1234abc have occurred in an accounting period <=x (column h in my base data sheet), and ditto for each nominal code occurring in my base data sheet. I then want to return these summed amounts in column 'c' of my reporting sheet, against the corresponding nominal code. I have been told that the best way to do this is to use an ADO connection and create a data set in memory. As I am working within one sheet, is this really necessary?

RE: Sorting and summing large amounts of data

Hi Tracey

Thanks for your question

This is hard to answer without seeing the actual file. Could you email me an example (with dummy data if necessary) and then I can get back to you

my email is sw@stl-training.co.uk

Regards

Stephen

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Counting Non Number Cells (Text)

If you try to use the COUNT FUNCTION =COUNT(Cell range)with a range of cells with numbers and or containing text fields you wil find that that the text cells will be excluded from the the count. If you want to include them try the the COUNTA FUNCTION =COUNTA(Cell range). This counts both text and number cell values.

View all Excel hints and tips


Server loaded in 0.07 secs.