View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Conditionally summing data from two columns depending on their value.

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!