Lil Simpler

  • Thread starter Thread starter ksnapp
  • Start date Start date
K

ksnapp

ok

i need to check row A in my selection for cetain words, if the cells
say specifiec things(criteria) then number to their right need to be
summed. If they don't meet the criteria I need them ignored. I have
so far been unsuccessful with logical functions.

Also is there any I can make the answer show up in a cell?

Regards
 
=SUMIF(A1:A100,"cat",B1:B100)

=sumif(range,criteria,sum_range)

This will search Col A for the word Cat and every time it finds it it will add
in the value from Col B.
 
Hi
not finding your other post but maybe the following will help you (if
you don't want to use application.worksheetfunction)

sub foo()
dim rng as range
dim cell as range
dim criteria as string
dim ret_value
criteria = "Test_value"
set rng = range("A1:A100")
for each cell in rng
if cell.value=criteria then
ret_value = ret_value + cell.offset(0,1).value
end if
next
msgbox ret_value
end sub
 
Back
Top