# MULTIPLE IF STATEMENTS

#### wilcor

##### New Member
HAVING A LITTLE TROUBLE. I need help on if statements.

EXAMPLE:

IF B2:1000=20 AND C2:10000=AL, SUM D2:1000

Any help will be appreciated.

Bill

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

#### Brian from Maui

##### MrExcel MVP
Bill,

Use SUMPRODUCT

=SUMPRODUCT((B2:B1000="20")*(C2:C1000="AL"),D2:D1000)

Although now I see your ranges are not the same size. To use SUMPRODUCT all ranges must be the same size
This message was edited by Brian from Maui on 2002-10-01 12:56

#### wilcor

##### New Member
I used the formula
=SUMPRODUCT((B2:B1000="20")*(C2:C1000="AL"),D2:D1000)

It gave me a total of 0 when the total of D2;D1000 was actually 4222. Col D represents miles driven by a truck.

I must be doing something wrong.

Any more suggestions.

Bill

#### Tom Urtis

##### MrExcel MVP
Remove the quotes that surround 20.

#### Brian from Maui

##### MrExcel MVP
Thanks Tom!
This message was edited by Brian from Maui on 2002-10-01 13:12

#### wilcor

##### New Member
Thanks Tom

That worked nicely. Wish I was there. Gotta go now and play 18 holes.

Bill Cortner

Replies
9
Views
161
Replies
3
Views
292
Replies
3
Views
362
Replies
9
Views
1K
Replies
6
Views
571

1,181,106
Messages
5,928,101
Members
436,588
Latest member
mummabare

### 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