I have a table of yearly statistics for baseball teams from 1876 through 2001. Each record is the data for a specific team in a specific year, and the several fields in a record show the number of home runs, the number of strikeouts, etc., that the team accumulated for that season.
It's simple to extract the data for a single year using the sumproduct formula, and if I rewrite the formula, I can get all the data from a certain forward or all data before that year.
=sumproduct((A3:A1000=1995)*(B3:B1000="Team")*(C2:C1000)) gets data from 1995 for the variable "Team"
=sumproduct((A3:A1000>=1995)*(B3:B1000="Team")*(C2:C1000)) gets it from 1995 through 2001
=sumproduct((A3:A1000<=1995)*(B3:B1000="Team")*(C2:C1000)) gets it from 1876 through 1995
The problem is that the formulas must be changed, which is tedious, and there is no way that I can think of to handle a range of years from the middle, e.g.. 1945-1958. Is there some way to do this with sumproducts and maybe named ranges (FirstYear, LastYear)?
Thanks,
Cliff
It's simple to extract the data for a single year using the sumproduct formula, and if I rewrite the formula, I can get all the data from a certain forward or all data before that year.
=sumproduct((A3:A1000=1995)*(B3:B1000="Team")*(C2:C1000)) gets data from 1995 for the variable "Team"
=sumproduct((A3:A1000>=1995)*(B3:B1000="Team")*(C2:C1000)) gets it from 1995 through 2001
=sumproduct((A3:A1000<=1995)*(B3:B1000="Team")*(C2:C1000)) gets it from 1876 through 1995
The problem is that the formulas must be changed, which is tedious, and there is no way that I can think of to handle a range of years from the middle, e.g.. 1945-1958. Is there some way to do this with sumproducts and maybe named ranges (FirstYear, LastYear)?
Thanks,
Cliff