Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Summing values within a matrix who are both in a column where theheaders are within a certain numerical range and in a row where the rowheaders are specified.

I have a matrix of car trip data where the row headings are categories
(such as "work trips", "shopping trips" ...) and the column headings
are lengths of the trip in miles (e.g. 1, 2, 3, 4...). The cell
values in the matrix are the number of trips of a particular distance
and within a particular category.

I wish to summarize the data in a table where the column headers are
ranges (e.g. 1-25, 26-50 ...) and the row headers are combined (e.g.
work+school, shopping+leisure, ...). The cell values in this summary
table are to be total miles traveled, i.e. a sumproduct of the trip
length multiplied by the number of trips for the particular distance
range and category range.

What is the formula for the cells within this summary table?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Summing values within a matrix who are both in a column where theheaders are within a certain numerical range and in a row where the rowheaders are specified.

On Nov 7, 12:03*am, Andy wrote:
I have a matrix of car trip data where the row headings are categories
(such as "work trips", "shopping trips" ...) and the column headings
are lengths of the trip in miles (e.g. 1, 2, 3, 4...). *The cell
values in the matrix are the number of trips of a particular distance
and within a particular category.

I wish to summarize the data in a table where the column headers are
ranges (e.g. 1-25, 26-50 ...) and the row headers are combined (e.g.
work+school, shopping+leisure, ...). *The cell values in this summary
table are to be total miles traveled, i.e. a sumproduct of the trip
length multiplied by the number of trips for the particular distance
range and category range.

What is the formula for the cells within this summary table?

Thanks!


Hello Andy,

If the matrix row headers are in A2:A20 and column headers in B1:Z1,
with data in B2:Z20 then you can use a formula like this to calculate
total mileage of work trips and shopping trips in the range 5 to 10
miles inclusive

=SUMPRODUCT(ISNUMBER(MATCH(A2:A20,{"work trips","shopping trips"},0))*
(B1:Z1=5)*(B1:Z1<=10)*B2:Z20*B1:Z1)

obviously you could replace the variables with cell references
depending on the setup of your table
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 265
Default Summing values within a matrix who are both in a column where the headers are within a certain numerical range and in a row where the row headers are specified.

Assumptions:

For the source table...

A2:A10 contains the row headers/category

B1:E1 contains the column headers/length of trip

B2:E10 contains the data/number of trips

For the results table...

G3 contains the first of the combination of categories, such as 'Work
Trips' (needs to match the categories listed in A2:A10)

H3 contains the second of the combination of categories, such as
'Shopping Trips' (needs to match the categories listed in A2:A10)

And so on for the rest of Column G and Column H

I1 contains 1 and I2 contains 25

J1 contains 26 and J2 contains 50

And so on for other ranges

Formula:

I3, confirmed with CONTROL+SHIFT+ENTER, copied across and down:

=SUM(IF(ISNUMBER(MATCH($A$2:$A$10,$G3:$H3,0)),IF($ B$1:$E$1=I$1,IF($B$1:$
E$1<=I$2,$B$1:$E$1*$B$2:$E$10))))

Adjust the ranges, accordingly.

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions

In article
,
Andy wrote:

I have a matrix of car trip data where the row headings are categories
(such as "work trips", "shopping trips" ...) and the column headings
are lengths of the trip in miles (e.g. 1, 2, 3, 4...). The cell
values in the matrix are the number of trips of a particular distance
and within a particular category.

I wish to summarize the data in a table where the column headers are
ranges (e.g. 1-25, 26-50 ...) and the row headers are combined (e.g.
work+school, shopping+leisure, ...). The cell values in this summary
table are to be total miles traveled, i.e. a sumproduct of the trip
length multiplied by the number of trips for the particular distance
range and category range.

What is the formula for the cells within this summary table?

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Summing values within a matrix who are both in a column where theheaders are within a certain numerical range and in a row where the rowheaders are specified.

On Nov 7, 3:40*am, barry houdini wrote:
On Nov 7, 12:03*am, Andy wrote:



I have a matrix of car trip data where the row headings are categories
(such as "work trips", "shopping trips" ...) and the column headings
are lengths of the trip in miles (e.g. 1, 2, 3, 4...). *The cell
values in the matrix are the number of trips of a particular distance
and within a particular category.


I wish to summarize the data in a table where the column headers are
ranges (e.g. 1-25, 26-50 ...) and the row headers are combined (e.g.
work+school, shopping+leisure, ...). *The cell values in this summary
table are to be total miles traveled, i.e. a sumproduct of the trip
length multiplied by the number of trips for the particular distance
range and category range.


What is the formula for the cells within this summary table?


Thanks!


Hello Andy,

If the matrix row headers are in A2:A20 and column headers in B1:Z1,
with data in B2:Z20 then you can use a formula like this to calculate
total mileage of work trips and shopping trips in the range 5 to 10
miles inclusive

=SUMPRODUCT(ISNUMBER(MATCH(A2:A20,{"work trips","shopping trips"},0))*
(B1:Z1=5)*(B1:Z1<=10)*B2:Z20*B1:Z1)

obviously you could replace the variables with cell references
depending on the setup of your table


Dear Barry,

This solution works perfectly and will save me a LOT of time! Thanks
very much for your time and help!

Andy
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Summing values within a matrix who are both in a column where theheaders are within a certain numerical range and in a row where the rowheaders are specified.

On Nov 7, 4:03*am, Domenic wrote:
Assumptions:

For the source table...

A2:A10 contains the row headers/category

B1:E1 contains the column headers/length of trip

B2:E10 contains the data/number of trips

For the results table...

G3 contains the first of the combination of categories, such as 'Work
Trips' (needs to match the categories listed in A2:A10)

H3 contains the second of the combination of categories, such as
'Shopping Trips' (needs to match the categories listed in A2:A10)

And so on for the rest of Column G and Column H

I1 contains 1 and I2 contains 25

J1 contains 26 and J2 contains 50

And so on for other ranges

Formula:

I3, confirmed with CONTROL+SHIFT+ENTER, copied across and down:

=SUM(IF(ISNUMBER(MATCH($A$2:$A$10,$G3:$H3,0)),IF($ B$1:$E$1=I$1,IF($B$1:$
E$1<=I$2,$B$1:$E$1*$B$2:$E$10))))

Adjust the ranges, accordingly.

--
Domenic
Microsoft Excel MVPwww.xl-central.com
Your Quick Reference to Excel Solutions

In article
,

*Andy wrote:
I have a matrix of car trip data where the row headings are categories
(such as "work trips", "shopping trips" ...) and the column headings
are lengths of the trip in miles (e.g. 1, 2, 3, 4...). *The cell
values in the matrix are the number of trips of a particular distance
and within a particular category.


I wish to summarize the data in a table where the column headers are
ranges (e.g. 1-25, 26-50 ...) and the row headers are combined (e.g.
work+school, shopping+leisure, ...). *The cell values in this summary
table are to be total miles traveled, i.e. a sumproduct of the trip
length multiplied by the number of trips for the particular distance
range and category range.


What is the formula for the cells within this summary table?


Thanks!


Dear Domenic,

This is also a great solution and I've tried it and it works great.
Thanks for your help!

Andy
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing numerical values based upper and lower range jrmcosmo Excel Discussion (Misc queries) 4 September 22nd 09 04:58 PM
Adding numerical values based on multiple values in another column Kazmaniac Excel Worksheet Functions 6 April 4th 07 08:53 PM
Summing non hidden values in a range starguy Excel Discussion (Misc queries) 38 May 4th 06 09:38 PM
Return Range of Numerical Values in Single Column based on Frequency Percentage Sam via OfficeKB.com Excel Worksheet Functions 9 October 28th 05 11:01 PM
Summing values within a range rmellison Excel Discussion (Misc queries) 7 September 2nd 05 12:43 PM


All times are GMT +1. The time now is 08:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"