View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default SPREAD SHEET FORMULA

If you understand your question correctly, this formula should give you the
totals you want...

=SUMPRODUCT((A2:A1000="NJ")*D2:D1000)

Just change the "NJ" to the state you want and change the range to cover the
maximum number of rows you think you will need (make sure the A range and
the D range are the same size).

--
Rick (MVP - Excel)


"AINS" wrote in message
...
I HAVE A SPREAD SHEET THAT I CANNT SORT WITHOUT MESSING UP THE FORMULAS THE
LAY OUT IS AT FOLLOWS

A B C
D
STATE ODOMETER START ODOMETER STOP MILES
PA
OH
NJ
CT
NH


I NEED A FORMULA TO ADD EACH STATES MILES AND OF COURSE THEY ARE NOT IN
ORDER, I NEED MY FORMULA TO RECOGNIZE THE STATE AND ONLY ADD THOSE MILES
TOGETHER??? HELP