View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RJanz RJanz is offline
external usenet poster
 
Posts: 7
Default Combining IF, ANd and SUM functions in a formula

The row ranges correspond.
thanks

"Ken Johnson" wrote:

On Jan 4, 10:25 am, Ken Johnson wrote:
On Jan 4, 9:42 am, RJanz wrote:

I'm trying to add the amounts in a column where two other columns match the
set criteria, however, it is comparing the first cell only to the text
specified. Does anyone know how I overcome this or correct the formula below?


=IF(AND(Source!$A$2:$A$9999="X",Source!$C$1:$C$999 9="Y"),SUM(Source!$G$1:$G$9999),0)


Maybe
=SUMPRODUCT(--(Source!$A$2:$A$9999="X"),--(Source!$C$2:$C
$9999="Y"),Source!$G2:$G9999)

which sums only those column G values that are in rows where column A
has X or x and column C has Y or y.
Ken Johnson


Also, be careful with the range of row values, they must correspond ie
either 1 to 9999 for each of A, C and G, or 2 to 9999 for each of A, C
and G, not a mixture, otherwise you will get the #VALUE! result.

Ken Johnson