# Formula not adding correct figure

#### jimboy

##### Well-known Member
I want this formula to add up the lines that meet this criteria, but it only adds them up if all the lines meet the creteria, can anyone help?
{=SUM(IF(AND(\$I\$1=A1:A29,\$J\$1>B1:B29,\$J\$1<C1:C29),D1:D29))}

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.
On 2002-08-28 08:24, jimboy wrote:
I want this formula to add up the lines that meet this criteria, but it only adds them up if all the lines meet the creteria, can anyone help?
{=SUM(IF(AND(\$I\$1=A1:A29,\$J\$1 > B1:B29,\$J\$1< C1:C29),D1:D29))}

Try:

=SUMPRODUCT((\$I\$1=A1:A29)*(\$J\$1 > B1:B29)*(\$J\$1< C1:C29),D1:D29)

AND returns a scalar value, not an array-constant which formulas operating on arrays need.

The formula above is entered normally.
This message was edited by Aladin Akyurek on 2002-08-28 08:38

Replies
0
Views
385
Replies
3
Views
2K
Replies
3
Views
952
Replies
0
Views
352
Replies
5
Views
1K

1,203,242
Messages
6,054,350
Members
444,718
Latest member
r0nster

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back