# Help with SUMPRODUCT formula

#### Kyroc

##### New Member
Could someone please tell me how to write a formula for this that works, I believe it should be a sumproduct formula but I can't get my head around it. I have never used a sumproduct formula before.

I have a row of numbers 1 to 31 representing days of the month.
Underneath I have a figure representing revenue for each day of the month.
In another cell I have a drop down box with the numbers 1 to 31 also representing days of the month.

I need a formula that will look at what number is selected in the drop down box and will sum the revenue for each day up to and including that day.

So for example I have revenue for every day for 31 days, however I want the total revenue I had reached on day 13 of the month, so I select day 13 from the drop down box and the formula should show me total revenue from day 1 to 13.

=SUMPRODUCT(--(\$E\$2:\$AI\$2=H20),--(\$E\$2:\$AI\$2<=H20),--(\$E\$13:\$AI\$13))

This is the formula I was using. E2:AI2 represent the 1 to 31 days of the month. H20 is the cell of the drop down box where you select the day of the month and E13:AI13 is the row of revenue.

The formula above just displays the value of revenue for the date selected instead of summing the revenue from day 1 until the day selected.

Any help would be appreciated.

### Excel Facts

Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Welcome to MrExcel.

Just remove the first condition:

=SUMPRODUCT(--(\$E\$2:\$AI\$2<=H20),(\$E\$13:\$AI\$13))

You are a life saver. Thank you so much!

Replies
0
Views
227
Replies
1
Views
130
Replies
16
Views
572
Replies
4
Views
313
Replies
0
Views
152

1,218,888
Messages
6,145,016
Members
450,585
Latest member
airc72

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