sorting and summing large
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Sorting and summing large amounts of data

resolvedResolved · Medium Priority · Version 2007

replyReply Mon 4 Apr 2011, 15:12Delegate Tracey said...

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?

For upcoming training course dates see: Pricing & availability

replyReply Mon 11 Apr 2011, 15:38Trainer Stephen said...

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

Regards

Stephen

 

Please browse our web site to find out more about
excel computer training and other Microsoft training courses.

Excel tip:

Display pictures on Chart Data Point

Replacing a single chart data point bar with a picture.
Step 1: Left click on a bar. Then, wait, and do a second single click on the bar. This will select just one data point.

Step 2: Right click on the bar and select Format Data Point.

Step 3: On the fill effects tab, choose a picture. Browse for a picture for that bar. Indicate if you want it to be stretched or stacked. Repeat for each bar.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard