Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have two columns of data: mileage in A2:A20 and number of passengers
in B2:B20. Each row corresponds to a particular trip. I wish to sum the number of passenger-miles for trips that have traveled within a distance range of my discretion (the lower and upper bounds are specified in A22:A23). How would I do this? Thanks! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
One way...
=SUMIF(A2:A20,"="&A22,B2:B20)-SUMIF(A2:A20,""&A23,B2:B20) -- Biff Microsoft Excel MVP "Andy" wrote in message ... I have two columns of data: mileage in A2:A20 and number of passengers in B2:B20. Each row corresponds to a particular trip. I wish to sum the number of passenger-miles for trips that have traveled within a distance range of my discretion (the lower and upper bounds are specified in A22:A23). How would I do this? Thanks! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks Biff for the quick solution!
(I would add that there should be = in both instances, so as not to double count entries.) On Nov 23, 10:47*am, "T. Valko" wrote: One way... =SUMIF(A2:A20,"="&A22,B2:B20)-SUMIF(A2:A20,""&A23,B2:B20) -- Biff Microsoft Excel MVP "Andy" wrote in message ... I have two columns of data: mileage in A2:A20 and number of passengers in B2:B20. *Each row corresponds to a particular trip. *I wish to sum the number of passenger-miles for trips that have traveled within a distance range of my discretion (the lower and upper bounds are specified in A22:A23). *How would I do this? Thanks! |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
there should be = in both instances
Then that means you want to *exclude* the upper boundary. 10...1 12...1 11...1 15...1 Boundaries: A22 = 10 A23 = 15 =SUMIF(A2:A20,"="&A22,B2:B20)-SUMIF(A2:A20,"="&A23,B2:B20) Returns 3 =SUMIF(A2:A20,"="&A22,B2:B20)-SUMIF(A2:A20,""&A23,B2:B20) Returns 4 -- Biff Microsoft Excel MVP "Andy" wrote in message ... Thanks Biff for the quick solution! (I would add that there should be = in both instances, so as not to double count entries.) On Nov 23, 10:47 am, "T. Valko" wrote: One way... =SUMIF(A2:A20,"="&A22,B2:B20)-SUMIF(A2:A20,""&A23,B2:B20) -- Biff Microsoft Excel MVP "Andy" wrote in message ... I have two columns of data: mileage in A2:A20 and number of passengers in B2:B20. Each row corresponds to a particular trip. I wish to sum the number of passenger-miles for trips that have traveled within a distance range of my discretion (the lower and upper bounds are specified in A22:A23). How would I do this? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Summing values, x rows deep, depending on a criterion | Excel Worksheet Functions | |||
summing columns if there is data | Excel Worksheet Functions | |||
Conditionally summing cells based on conditions in other rows | Excel Worksheet Functions | |||
summing data in several columns | Excel Discussion (Misc queries) | |||
Lock and unlock cells conditionally depending on input in another | Excel Worksheet Functions |