Multiple Sumproduct issue, using rows and columns

bat18

Board Regular
Joined
Mar 29, 2010
Messages
89
I have a tricky question which i can't get my head round and was hoping for some assistance.

i need to do a sumif on multiple criteria (so a sumproduct is needed but it is causing issues)

I need it to sum on the following criteria

1. Cell B1 = something in column C
2. Cell D3 = something in row 4 (E4:FF4)
3. It only sums the first x amount of times that cell D3 appears in row 4. x will be based on the number entered into A1

I have used an offest forumla to get numbers 1 and 3 working but can not get number 2 into my formula.

Any help would be really appreciated.

Cheers
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Can you post the formula you tried? Also, some sample data would be helpful.

=SUMPRODUCT(($C$5:$C$822=$B1)*OFFSET($AE$5:$AE$822, 0, 0, ROWS('[Unity Database 10.05.12.xlsx]Input'!$AE$5:$AE$822),($A$1)))

This formula is what i had originally which summed from column AE onwards for x amount of columns depending on what was entered into A1.

I need to adapt this now but have just realised there may be an easier way.

I simply need to sumif based on data in a row and not a column.

So for example

Every time the word 'Food' is in row 4 you would sum the cells directly underneath the word food.

That is the first problem

BUT

I only want to sum the first x amount of times 'Food' appears in the row and that is dependent on the number entered into A1.

Let me know if that made any sense. Basically ignore the first post in this thread as this is now my problem.

Cheers
 
Last edited:
Upvote 0
No but they are equally spaced apart, although i would rather the formula picked it up regardless of where it appeared in row 4.
 
Upvote 0
With this sample data in A4:L14:

Excel Workbook
ABCDEFGHIJKL
4FoodOtherOtherFoodOtherOtherFoodOtherOtherFoodOtherOther
549718483294397072786
620798036733682311965375
71671539548864565896661
8100268142906567724662226
9318438038793178266879
1050634448724192744867669
111599465891843163484557
1288212757461949380161710
134353788458255017459811
14471362262195613818893763
Sheet4



try this formula:

=SUMPRODUCT((A4:L4="Food")*A5:L14*(COUNTIF(OFFSET(A4,0,0,1,COLUMN(A4:L4)),"Food")<=A1))
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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
Back
Top