If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Functions that return values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-04, 11:03
tjarvas tjarvas is offline
Registered User
 
Join Date: Mar 2004
Posts: 361
Functions that return values

I am trying to write a function that returns a value that meets certain criteria. I have a worksheet that has about 40 rows and I want to return the number to a different worksheet that meets two criteria. What function would you recommend.

Ex if value in column A = Tree and value in column B = 1999 then total and show on a different worksheet.

Hope that is clear enough.

Thanks
Reply With Quote
  #2 (permalink)  
Old 03-24-04, 12:02
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Re: Functions that return values

Is this what your after?

=SUMPRODUCT((A1:A40 = "Tree")*(B1:B40 = 1999)*(C1:C40))

where A has to equal Tree, B has to equal 1999 and C is a Number
This sums the numbers when A is True and B is True sum the values in C

David
Reply With Quote
  #3 (permalink)  
Old 03-24-04, 12:19
tjarvas tjarvas is offline
Registered User
 
Join Date: Mar 2004
Posts: 361
Thanks that perfect
Reply With Quote
  #4 (permalink)  
Old 03-24-04, 12:38
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Just as a reminder, when you use SUMPRODUCT, you have to specify the rows. You cannot use A:A (as you can in other functions), it has to be A2:A50 or something like that.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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