View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] pierce.andy@gmail.com is offline
external usenet poster
 
Posts: 5
Default Need help with formula

I'm sorry for being so confusing here. Rather than responding to your
message, let me just restate my problem.

My spreadsheet contains the following 2 columns [Animal} and [Points},
with the following data that will be expanded. Suppose each animal
plays a game, so in the following chart 9 games have been played. In
the first game, Monkey scored 10 points; in the next game Gorilla
scosred 20 point.

[Animal] [Points}
Monkey 10
Gorilla 20
Dog 30
Monkey 15
Dog 20
Cat 10
Monkey 30
Gorilla 20
Gorilla 30

I am looking to find out how many points Gorilla scored in the last 2
games that Gorilla played. In this case, the answer would be 50. If
the variable was Monkey, instead of Gorilla, the answer would be 45.

I need a formula that finds the last 2 scores for the animal I am
analyzing.

Thanks again.

PCLIVE (RemoveThis) wrote:
I'm not sure the example you've given is correct. If you total the numbers
in column B for "abc" from column A, then the total should be 7. I'm
guessing this is what you want. If 7 is the correct answer, then maybe:

=SUMIF(INDIRECT("A1:A"&COUNTA(A:A)),INDIRECT("A"&C OUNTA(A:A)),B:B)

For the second to last entry in column A:

=SUMIF(INDIRECT("A1:A"&COUNTA(A:A)),INDIRECT("A"&C OUNTA(A:A)-1),B:B)


HTH,
Paul

wrote in message
ups.com...
Suppose you have 2 columns of data. Data gets added to the columns
frequently.

A B
xyz 4
abc 3
jkl 5
xyz 2
abc 1
def 4
abc 3

I need to calculate the total number in column B for the last 2
entries. Thus, if looking for "abc", the answer would be 4 (3+1),
since the abc got a 3 the last entry and 1 for the previous entry.
Using the same formula for xyz would return 6 (2 +4).

Any ideas on how I can accomplish this?