ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Lil Simpler (https://www.excelbanter.com/excel-programming/293345-lil-simpler.html)

ksnapp[_16_]

Lil Simpler
 
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


---
Message posted from http://www.ExcelForum.com/


Ken Wright

Lil Simpler
 
=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.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"ksnapp " wrote in message
...
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


---
Message posted from http://www.ExcelForum.com/



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.608 / Virus Database: 388 - Release Date: 03/03/2004



ksnapp[_19_]

Lil Simpler
 
see i need vba code this issue is more complex. See my post title
"conditional

--
Message posted from http://www.ExcelForum.com


Frank Kabel

Lil Simpler
 
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



--
Regards
Frank Kabel
Frankfurt, Germany

see i need vba code this issue is more complex. See my post titled
"conditional"


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 10:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com