VBA Code - Summing Groups Of Numbers

Jul 17, 2014

Product Group Arg.Braz.Mex.Peru
Red paint Paint5324
Blue paintPaint5684
WallpaperWallpaper6585
LampsFurniture 4631
ChairsFurniture 1645
Green paintPaint1356
SofasFurniture 3358

SUM(Paint,Argentina)SUM(Paint,Brazil)SUM(Paint,Mexico)SUM(Paint,Peru)
SUM(Wallpaper,Argentina)SUM(Wallpaper,Brazil)SUM(Wallpaper,Mexico)SUM(Wallpaper,Peru)
SUM(Furniture,Argentina)SUM(Furniture,Brazil)SUM(Furniture,Mexico)SUM(Furniture,Peru)

I am trying to work out VBA code or another way in Excel to find a solution for this problem - I need to be able to sum up the values that I have posted below - so for SUM(Paint,Argentina), this would be the sum of the red paint, blue paint and green paint values under the Argentina heading, that are all categorised into the 'Paint' group. The same follows for all the other categories. I was trying to use 'Defined Names' to group the categories together, and so would then do =Sum(Paint). However this was not allowing me to sum by each country, and the 'Create from Selection' naming tool was not naming all of the values for Paint (blue paint, red paint, etc.) under the paint category.

This is an incredibly simplified version of the data I am actually dealing with - I am doing this for 70 country columns and 250 rows of product categories.

View 4 Replies


ADVERTISEMENT

Summing Groups

Apr 16, 2008

What I want is to sum any/all groups of numbers larger than 0 that are grouped in 4 or more....e.g. in my example D1:G1. The answer should be 150.... I'm trying this formula: ...

View 9 Replies View Related

Summing The Items Of Each Of Different Groups In A Table

Nov 24, 2009

Items, of 3 different groups, and their values are entered in a table progressively, over a year period . I am trying to work out a way of getting the month total value of each of the 3 groups seperately, for each month of the year. A sample worksheet is attached

View 10 Replies View Related

Summing Unique Numbers In A Set Of Reoccurring Numbers

Dec 23, 2011

I have a problem in terms of summing unique numbers in a set of reoccurring numbers. Due to the restrictions in the spreadsheet I am unable to use a filter / advanced filter or pivot table. What I basically want to do is sum every time there is a different number. In this case it's:

37.85+80.61+129.38+185.85+1259.69+104.96

The unique numbers have a maximum of 6 and a minimum of 3. Is there a generic formula that I can apply so that it only counts / sums the number once. I can use VBA code or just a simple array. I'm just not familiar with any sort of functions that can do this.

37.9537.9537.9537.9580.6180.6180.6180.61129.38129.38129.38129.38185.85185.85185.85185.851259.691259
.691259.691259.691259.691259.691259.691259.691259.691259.691259.691259.691259.691259.691259.691259
.691259.691259.691259.691259.69104.96104.96104.96104.96104.960.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00

View 9 Replies View Related

Comparing Groups Of Numbers For Duplicates

Jan 1, 2010

I am trying to solve is as follows, I have groups of 20 numbers in columns, one per column and would like to compare the groups to determine if any group is duplicated on another line.

I had been looking at using VBA to copy the numbers to an array, sort from lowest to highest, concatenate and use that to compare each group. If possible however if there is a suitable formula it would be preferable.

I have attached a small sample to illustrate.

View 8 Replies View Related

Separating Mass Groups Of Numbers?

Jul 11, 2012

I am trying to separate a huge group of phone numbers from one cell into individual cells in a column. the numbers are currently separated by a semicolon. Is there an easy way to perform this action?

View 5 Replies View Related

Macro To Extract Numbers In Groups

May 8, 2013

I have a workbook called PETB. I would like to extract the following account number ranges in Col A to sheet 2 (the numbers are all 6 digits) for eg 273000

1) All numbers starting with 2730 and ending in a zero and 02 to be extracted together in one group for eg 273000, 273050, 273250, 273002, 273052 to be extracted below each each

2) All numbers starting with 2730 and ending in a 4 to be extracted together in one group

3) All numbers starting with 2730 and ending in a 6 to be extracted to together in one group

View 2 Replies View Related

List Permutations Of FOUR Groups From SEVEN Numbers

May 21, 2013

I have SEVEN numbers and FOUR groups.

What I would like to do is list ALL the PERMUTATIONS of those SEVEN numbers in FOUR groups.

So basically, the groups would look like...

7000
4210
4201
4111
4003
3400
3310
3301
3301
3220

[code].....

...and EACH group would add up to SEVEN etc.

I think there are a total of 840 different PERMUTATIONS available, from anything from 0 numbers in a group to 7 numbers in a group.

I need ALL these groups listed individually .Is there some code that will do this?

View 4 Replies View Related

Grouping List Of Numbers Into 5 Equal Groups

Nov 2, 2011

I have a list of 600 figures (this may vary) but i need a formula that will look a one particular figure in this list and return if it is one of 5 equal groups. e.g in this example the lowest 125 figures in numeric order would be in group 1 up to the highest 125 figures would be in group 5.

I realise if I limit it to 4 groups then i could use the 'quartile' functions but i am stuck with 5 groups.

View 3 Replies View Related

Splitting Large Numbers Into Groups (LATITUDE AND LONGITUDE)

Nov 16, 2009

I have a spreadsheet with a column of Longitude values like:
A
172828.383E

I want to somehow split the cell into new individual cells so it will be like this:

A B C
17 28 28.383

View 5 Replies View Related

Code To Break A Number Down Into Groups

Jun 10, 2009

i need code that can look at cell d23 and take that number( say it is 13) and break it down into groups. that have 3, 4 or 5 per group. in this example 13 can be broken down into

View 3 Replies View Related

Fill Range With Sequential Numbers Based On Corresponding Column Groups

Feb 15, 2010

In the attached workbook I'm trying to populate Column E with sequential numbers (as shown) based upon a changing range (defined as a named range called 'range'). Is it possible to write a formula in the cells in Column E that will do this?

View 2 Replies View Related

Summing A Row Of Numbers Containing: VALUE

May 14, 2007

I have a row of numbers that I want to sum. However some of the data could not be retrieved and that means in some cells in the row of numbers contain the message: " #VALUE " and when doing SUM it returns #VALUE

View 4 Replies View Related

Create A Function That Numbers Rows With Respect To Data Groups In A Column

Dec 1, 2007

I need to create a function that numbers rows with respect to data groups in a column (column labeled "Type" in this example). The result would be that shown in column A in this table.

How do I write the function?
#TypeName Date
1CarsJohn1/12/2008
2CarsJane11/10/2007
3CarsMary11/2/2004
4CarsBob12/7/2003
1TrucksMike12/12/2007
2TrucksSandy1/3/2007
3TrucksDale12/14/2006
4TrucksVince4/8/2005

*

View 10 Replies View Related

Summing Random Numbers?

Feb 23, 2014

I have a process that generates the value X in cell A1 randomly. So I can change the value of X in A1 by clicking on F9. I want to sum a sequence of X values. I can do this by manually copying each X to a row of cells and then summing the row values. But that is tedious. Can the summation be done automatically without being regarded as being circuler?

View 8 Replies View Related

Summing Numbers Even If They Don't Exist?

Jun 3, 2014

I want to sume numbers that may or may not be in several cells. If I use the function SUM and one of them is missing, I get an error.

Example:
A1=2
A2="empty"
A3=5

I want the sum of A1+A2+A3 to be 5

View 6 Replies View Related

Summing Every 7 Numbers In Column

Apr 10, 2014

I have a column of numbers (each cell represents number of chicken eggs produced daily). Column data runs from K9:K415

I want a formula in column M starting at M9 whereby cell M9 sums up the total number of eggs for the week (i.e. sum of K9:K15), then I want to copy that formula down, such that M10 shows the sum total of eggs for the next week (which is sum of K16:K22) and so on. Thus summing up every 7 rows of data in column M.

I have been playing with the SUM and OFFSET functions but can't quite nail it.

View 1 Replies View Related

Summing Numbers In A Series

Nov 15, 2008

The series 1,3,6,10,15,21,28,36 ("A" series) is the ongoing sum of 1+2+3+4+5+6+7+8 ("integers") and naturally goes on for as long as on chooses. I am only interested in the numbers up to 100.

Is there an Excel function that will allow me choose any integer as a starting point and any higher integer as an ending point and provide the sum of the "A" series associated with the two choices.

For example: If I begin at 6 and end on 12 it would give me 308 =28+36+45+55+66+78


00
11
23
36
410
515
621
728
836
945
1055
1166
1278
1391

View 9 Replies View Related

Summing Custom Numbers

Dec 21, 2008

I have a list of 100 songs and the artists that sing each song.

What I want is a formula that will look at the rank that it finishes with and assign it a different number (e.g. the song that finished at number 1, has a value of 100).

As there can be multiple songs by the one artist, I need to add them ALL up and have a total score for each singer/band.

e.g.

1 Powderfinger - My Happiness (100 points)
2 U2 - Beautiful Day (99 points)
3 Powderfinger - My kind of scene (98 points)
4 Wheatus - Teenage Dirtbag (97 points)
5 Coldplay - Yellow (96 points)

So Powderfinger would have 198 points and the other 3 would have 99, 97 and 96.

The band names are in one column and the song names are in the next column.

View 9 Replies View Related

Summing Numbers When Certain Criteria Are Met

Jun 16, 2009

I would need to get this next thing working:


H I J K L M N O P
Type No. No.Points Points/RN Points/KR Points/KV Points/ER R/V Total
5 KV 12 4 2 3 4 6 0 8
6 RN 90 18 3 4 5 8 0 26
7 KV 12 4 4 4 5 6 10 13
8 ER
9 KV
10 KR
...and so on, with the following logic

If Type = KV, then P$ = sum(J$,M$,O$), but if it is something else, like RN, then it needs to sum J$,K$,O$

I've tried using the following:


=IF(ISNUMBER(SEARCH("KV";H2));SUM(J2+M2+O2);0;IF(ISNUMBER(SEARCH("ER";H2));SUM(J2+N2+O2));
but only the two first ifs work, which is kind of logical, since the second if is the "value if false" statement. Is there any way to get this to work?

View 9 Replies View Related

Summing First 5 Numbers In Range With Conditions?

Jul 27, 2012

I have a spreadsheet which has data in rows. I need to sum the first 5 values from the left of the range which are greater than zero. BUT if there are less than 5 non zero values present I want to sum from the right of the range.

First condition:
1 2 3 4 5 6 7 8 9 10
The function would return: 1+2+3+4+5 = 15

Second condition:
0 0 0 4 5 6 7 8 9 10
Function would return: 4 + 5 + 6 + 7 + 8 = 30

Third condition:
0 0 0 0 0 0 0 8 9 10
The function would return: 10 + 9 + 8 = 27

I have had success with:
=B4+SUM(SMALL(IF(I4:O4<>0,I4:O4),ROW(1:5)))
(using ctrl shift enter)
BUT it crashes when faced with the third condition.

I would also like to avoid ctrl-shift-enter functions if I can as I don't have much success copying them around the spreadsheet.

View 3 Replies View Related

Summing Whole Numbers Gives Non Whole Number Output

Aug 17, 2013

I have an unusual situation which is best explained by way of an attached example.

In summary adding and subtracting four cells containing integer values outputs an unexpected non-integer value, which should in fact be zero.

The situation is best explained by way of example which I attach to this post : Excel Problem.xlsx

Basically, Cell E1 should be zero.

View 4 Replies View Related

Summing Numbers Only If They Correspond To Another Column?

Mar 15, 2014

I added an attachment. Column A is my "week number" and column E is my sales amount.

I'm trying to create a formula that sums the sales amount, only if it corresponds to a certain week number. I know sumif formulas, but can't get them to work well for this. For example, I want it to sum all the sale that happened in week one, then all the ones in week 2, then all the ones in week 3, and so on. There has to be an easier way than doing a sumif for each individual week and manually changing the week number in the sum if formula.

Could there be a character you can use in a formula to make the sumif week number "running?" So you could then just type in the formula once and pull it all the way down for the year, so the formula will work for the every week throughout the year?

View 8 Replies View Related

Summing Numbers With Multiple Criteria

Aug 27, 2009

Column A: Start Date
Column B: End Date
Column C: Ethnicity Code (letter and number such as B1)
Column D: Hours

What I need to do is work out how many hours each ethnic group did in a specific month.

View 14 Replies View Related

Summing Cells Containing Numbers And Text

Apr 14, 2013

I have cell A1:A25. each with a number, and the same text "Hour(s)" So cell A1 would be 24 Hour(s) and so forth down to cell A25.

Due to the sheet being large, I can't just insert another column to list the text. I need for cell A26 to sum the numbers ignoring the test in the cells. I searched to forum, but didn't exactly find anything that works correct.

View 9 Replies View Related

Summing Cells With Text And Numbers

Apr 28, 2014

I do my indoor cricket team stats and I am having some trouble figuring out what formula to use in order to be able to sum a row of numbers where some cells may contain text and numbers or just text.

Please see the attached spreadsheet to understand what I'm talking about.

In the batting tab, when the batter gets out, they lose 5 runs. Outs are noted by St, R, B or C. In terms of runs, the scorers put wides and noballs to the batter on strike which are noted by W or N and this is worth 2 runs. Sometimes the batter on strike will get runs off a W or N so it's noted down as W+2 (which would give 4 runs) etc. So what I need to be able to do in the batting sheet is sum the total runs and count the number of outs.

In the bowling sheet, it's the same story as the batting tab, but I also need to be able to sum the number of extras given and count the number of wickets taken.

[URL].....

View 2 Replies View Related

Summing Numbers From Multiple Cells With Text?

May 9, 2014

I am looking for a formula which will sum numbers with less than symbols in front of them (i.e. they are text cells), and then replace the less than symbol again in the summed cell if initially present. The problem is that not every cell contains a < symbol, some of them are just numbers, and not every column contains a < symbol either.

e.g. I am looking for a formula which if entered in row 5 of this example would give these answers.

A
B
C
D

1
<0.001
<0.1
0.2
<0.01

2
<0.0001
0.1
0.2
<0.1

3
<0.0001
<0.2
0.2
<0.1

4
<0.001
<0.1
0.2
<0.01

5
<0.0022
<0.5
0.8
<0.22

View 11 Replies View Related

Differencing Sets Of Numbers, Multiplying, And Summing

Sep 1, 2008

I'd like automate consists of entering 56 numbers (up to 3 digits, 000-999) and finding the difference between today's numbers and yesterday's numbers. Then multiplying each difference by a set number (i.e. 1, 2, 3, 5, 10, 20, or 25). These numbers may, from time to time change (i.e. the 32nd entered number may be multiplied by 3 for 2 months, then we might swap out a product and then need to multiply by 5, etc). At the end, I need all 56 differences multiplied by their individual respective multipliers totaled. This needs to be done daily using previous days numbers and be able to change the multiplier without effective previous data.

I was trying to to this myself by Column 1 = multipliers, Column 2 = yesterdays' numbers and Column 3 = today's numbers. The calcualtions are done by excel and a total is summed. This I can do. However, each day i'd need to make a new file and enter yesterday's and today's numbers. This is time consuming. I'd like a system where I can just entere today's numbers and any changes to the multiplier and it will spit out the total.

If anyone can guide me or point me in any direction to accomplish this automation. I would greatly appreciate it. I'm pretty computer savvy, but just have not had the time to dwell into Excel.

For those interested in what this is for: I have a small business that sells instant lottery tickets. Each day we have to figure out the number of tickets sold the previous day. We have a notebook and manually write down numbers, do the substractions by a calculator and total. The table in the notebook is seperated by ticket values (i.e. $1 tickets, $5 tickets, etc). However, certain tickets run out or occasionally we need to move tickets to a different spot, thus the MULTIPLIER in the automated system would need to change.

View 12 Replies View Related

Summing And Searching With Words And Numbers In Different Columns

Jan 12, 2010

I'm looking to do the following below: column A would have numbers, column B would have words and a few columns over i would have the total of each same word

column A column B
60house
120car
30misc
52.25food
83.33gashouse 180.25
120.25housecar 120
25miscmisc 55
105foodfood 157.25
50.5gasgas 133.83

View 2 Replies View Related

Code For Summing Between Workbooks

Jun 4, 2008

i am trying to write a macro that will allow me to, while two workbooks are open and one is defined as active i.e

in workbook 1 i want the cell A1 to be defined as the sum of cell A2 and A3 in workbook 2.

i have a code that lets me do it but the problem is that this code (that i recorded) only gives me specific workbook names to work from..

i dont know if i make much sense but i would like the macro to work on any 2 workbook that are open and perhaps having flexibilty to choose would be great here is my attempt

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved