Help with SUMPRODUCT formula

Kyroc

New Member
Joined
Sep 9, 2014
Messages
7
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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Welcome to MrExcel.

Just remove the first condition:

=SUMPRODUCT(--($E$2:$AI$2<=H20),($E$13:$AI$13))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,713
Messages
5,833,272
Members
430,201
Latest member
Deepakpilla36

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top