Solved

Seperate, group and sum

Posted on 2013-11-13
10
222 Views
Last Modified: 2013-11-13
Hi,

I have attached a ss where i have two codes in appended in ColA, i need to seperate the XOP codes (after hyphon) as these have instances where they repeat, once seperated and grouped, i need to only have one line of these (the extra lines can be deleted) however i need to sum the numbers before the extra lines are deleted

e.g

Expr1                                                      Cash Transactions
XOP0000000000008661                        1862
XOP0000000000008661                        8068
XOP0000000000008661                        6450

I would like to end up with

XOP0000000000008661                        16470

And the same with all the other numbers, so im looking for one view of each code.

Many thanks
Seamus
EE-Sum-Up-Dupes.xlsx
0
Comment
Question by:Seamus2626
  • 5
  • 5
10 Comments
 

Author Comment

by:Seamus2626
Comment Utility
Just to clear up, the account number, the account number that is on the left hand side of the hyphon, may contain three different ac numbers, in the example above

DTP0000000000006607/XOP0000000000008661      
DTP0000000000006608/XOP0000000000008661      
DTP0000000000016173/XOP0000000000008661      

You would simply pick

DTP0000000000006607/XOP0000000000008661                     16470


and used the summed up numbers

Thanks
0
 
LVL 24

Expert Comment

by:Steve
Comment Utility
You can:

Add a column between A and B to create a new "blank" B
Add a name to the top (e.g. "expr2")
Highlight A and use Data>Text to columns > Delimited using "/".
This will split the second portion into column B
Create a pivot table based upon the whole data.
Use pivot table to sum and arange data.

Is this OK? See attached.
EE-Sum-Up-Dupes.xlsx
0
 

Author Comment

by:Seamus2626
Comment Utility
Thanks Barman, but i need this to be code driven as it may have to operate across many workbooks, and i cant have users engaging with pivots etc

So the code would need to seperate the account and customer ID, then where there is multipe customer ids, sum up the numbers for the multiple ID's and then delete the extra rows e.g


Expr 1                                                                         Cash Transactions M1
AP0000000000012593/IP0000000000017087          55602
AP0000000000012770/IP0000000000017087          26977
AP0000000000012790/IP0000000000017087          10096

We would be left with

AP0000000000012593/IP0000000000017087          92675

Many thanks
Seamus
0
 
LVL 24

Expert Comment

by:Steve
Comment Utility
Which columns need to be summed... all? M1?
There are a lot of columns there, can sum one or all, but would hate to loose something you need when a line is deleted.
0
 

Author Comment

by:Seamus2626
Comment Utility
Hi Barman, all columns need summing, thats whats making it so tricky!

Thanks
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 24

Expert Comment

by:Steve
Comment Utility
Could I ask... how does the data get to the excel file?
If this is a data extraction from a database it would be exceedingly simple to modify an SQL query to output as required.
If not, not a big issue, but worth asking.
0
 

Author Comment

by:Seamus2626
Comment Utility
Now you say it barman, it does come from an access database, what is your suggestion?

Many thanks
0
 
LVL 24

Accepted Solution

by:
Steve earned 500 total points
Comment Utility
Change the query to sum them after using a group by clause based upon a "RIGHT" statement...

Can you post the current query.
I will then change it to do the required magic.

Far far easier than using VBA as the result will be as desired.
Will loose the porting to the left of the "/" but will output in seconds and repeat easier.
0
 

Author Closing Comment

by:Seamus2626
Comment Utility
Thats all good, i know what to do from here!

Thanks
0
 
LVL 24

Expert Comment

by:Steve
Comment Utility
Glad to hear you are back on track.
ATB
Steve.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now