A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Excel - IF formula with range of cells



 
 
Thread Tools Display Modes
  #1  
Old January 7th, 2010, 11:45 PM posted to microsoft.public.excel.worksheet.functions
chris
external usenet poster
 
Posts: 2,039
Default Excel - IF formula with range of cells

I am trying to create a formula that if a range of cells contains a specific
value AND a range of cells in the next column contains a specific value, then
the corresponding cells in the third column will be summed. What I have is
below. It recognizes the formula as long as all the cells in the range of the
first two columns contain the respective specific values. Can anyone suggest
a corrected formula, so the values in the cell ranges can vary? Thanks!

=(IF((AND(A2:A500="Value 1",B2:B500="Value 2")),SUM(C2:C500)))
  #2  
Old January 8th, 2010, 12:01 AM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Excel - IF formula with range of cells

Chris,

Try this

=SUMPRODUCT((A2:A500="Value1")*(B2:B500="Value2")* (C2:C500))

Mike

"Chris" wrote:

I am trying to create a formula that if a range of cells contains a specific
value AND a range of cells in the next column contains a specific value, then
the corresponding cells in the third column will be summed. What I have is
below. It recognizes the formula as long as all the cells in the range of the
first two columns contain the respective specific values. Can anyone suggest
a corrected formula, so the values in the cell ranges can vary? Thanks!

=(IF((AND(A2:A500="Value 1",B2:B500="Value 2")),SUM(C2:C500)))

  #3  
Old January 8th, 2010, 12:24 AM posted to microsoft.public.excel.worksheet.functions
ryguy7272
external usenet poster
 
Posts: 1,593
Default Excel - IF formula with range of cells

Here's another way:
=SUMPRODUCT(--(A1:A13="vijayawada1"),--(B1:B13="vijayawada2"),C1:C13)

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Mike H" wrote:

Chris,

Try this

=SUMPRODUCT((A2:A500="Value1")*(B2:B500="Value2")* (C2:C500))

Mike

"Chris" wrote:

I am trying to create a formula that if a range of cells contains a specific
value AND a range of cells in the next column contains a specific value, then
the corresponding cells in the third column will be summed. What I have is
below. It recognizes the formula as long as all the cells in the range of the
first two columns contain the respective specific values. Can anyone suggest
a corrected formula, so the values in the cell ranges can vary? Thanks!

=(IF((AND(A2:A500="Value 1",B2:B500="Value 2")),SUM(C2:C500)))

 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.