Retrieve Sum value for dynamic data

Brad B

New Member
Joined
Jul 27, 2016
Messages
17
Hi,

I'm trying to create a formula that will allow me use some exported data to create a simple summary of it, which will be used for other calculations.

Our system exports data that looks like this:
Date
Item1
I want Item1 SUM here
Lot11000I want to drag the same formula all the way down, not modify a new one for each item, because the items will not be in the same place every time
Lot2500
Sum:1500
Item2I want Item2 SUM here
Lot1300
Lot2300
Lot3300
Sum:900

<tbody>
</tbody>
And so on...

I need to reference the item (I plan to use vlookup to get the sum for each item later, and I'm trying to create an intermediate step to get the sum for each item in the same row...maybe there is an easier way?)

Anyway, ultimately what I need is data that looks like this so I can use it elsewhere in the workbook.
Item11500
Item2900

<tbody>
</tbody>

I started with something like =IF($B2<>"",OFFSET($B2,COUNTA(C2:C4)+1,3),"")

I think I can use offset or index somehow, but I'm not sure how to because when I use COUNTA to find the amount of rows under an item, I don't know how to make sure I don't run into the data set for the next item (or make sure I capture all the data in a block), because the data sets can be of a different size every time (Not just Item1 being 2 rows and item 2 being 3 rows, but each item may vary daily: Item1 may have 3 lot numbers (rows) one day and 7 rows the next).

I'm sure this is doable, but I'm not sure how. Thanks for your help!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Perhaps:

F2: =IF(LEFT(B2,4)="Item", SUMPRODUCT(--(LEFT(C2:C$15,3)="Lot"),E2:E$15)-SUM(F3:F$15),"")


Excel 2010
ABCDEF
1Date
2Item11,500
3Lot11,000
4Lot2500
5Sum:1,500
6Item2Lot1150285
7Lot225
8Lot340
9Lot 470
10Sum:285
11Item3900
12Lot1300
13Lot2300
14Lot3300
15Sum:900
Sheet1
 
Upvote 0
Depending on data layout, it also could be something like this:

Book1
ABCDEFG
1Date
2Item11500Copy F2 down
3Lot11000
4Lot2500
5Sum:1500
6Item2900
7Lot1300
8Lot2300
9Lot3300
10Sum:900
Sheet1
Cell Formulas
RangeFormula
F2=IF(B2="","",VLOOKUP("Sum:",D2:$E$10000,2,0))


Or like that:

Book1
ABCDEF
1Date
2Item11500Copy E2 down
3Lot11000
4Lot2500
5Item2900
6Lot1300
7Lot2300
8Lot3300
Sheet2
Cell Formulas
RangeFormula
E2=IF(B2="","",SUM(D2:INDEX(D:D,ROW()+SUMPRODUCT(MATCH(1=1,D3:$D$10000="",0),1))))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,135
Messages
6,123,239
Members
449,093
Latest member
Vincent Khandagale

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