# My countif statement isn't working.

I have a count if statement that isn't working. On Sheet 1, column a, i have lots of different names. Many rows in column a are the same. In column b there is a value next to it. On sheet two, i put my count if statement. Say in sheet 2, column a, i have the name Ryan. In column b of sheet 2, i am trying to total all of those values on sheet 1, column b that have a value next to the name ryan, in column a. Does that make sense? So, i created a formula like this: =if(countif(sheet1!A:B,sheet2!A1),vlookup(sheet2!A1,sheet1!A:B,2,0),0). This formula has worked in the past, but for some reason its not right now. On Sheet 2, how do i sum up all of the values next  to Ryan on sheet 1? Thanks!!!!
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Sounds like you need SUMIF not COUNTIF, e.g. in sheet 2 B1 use this formula

=SUMIF(sheet1!A:A,A1,sheet1!B:B)

assumes you have the name in sheet2! A1

regards, barry

Experts Exchange Solution brought to you by