#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lil Simpler

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

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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/


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a simpler way to do this formula? Jenna Excel Worksheet Functions 5 March 1st 10 10:57 PM
VBA code simpler? mohavv Excel Discussion (Misc queries) 4 December 2nd 07 06:39 AM
Simpler Formula ... 2nd lowest value? Ken Excel Worksheet Functions 17 November 30th 06 01:41 PM
Complex formula vs. simpler GerryK Excel Worksheet Functions 3 December 6th 05 03:33 PM
Another (simpler?) printing problem Abi Excel Discussion (Misc queries) 9 January 13th 05 03:50 AM


All times are GMT +1. The time now is 11:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"