I have been working on a problem that involves counting cells in certain rows between certain rows that contain a specific parameter
I attach a workbook that shows the problem. This workbook is a “resolved” workbook in that it does what I want it to do ie it gets me the data I want in the cells I want: but it is cumbersome in that I have to do manual workings in column M – so I am looking for a work-round to omit columns L and M.
Basically, I am splitting down a long list of items that are grouped into headings in column B – for the purpose of this example, the headings would be fruit, and the items between headings different varieties of that fruit, with a quantity for each variety of fruit in column C.
In column D in the example, I put a “1” for a heading and a “3” for an item under that heading.
In columns F to J, I split the list into different classes (which doesn’t make much sense with fruit, but obviously does in the real spreadsheet). I want to be able to list the fruit headings according to class and the total amount in each fruit type by summing the quantities of each variety and then total up the amount of each class using the quantities of each fruit – all as shown in columns Q-Z.
Typically, in the actual workbook, I have between 5 and 700 lines of data in each worksheet (and about 40 worksheets per workbook) but that could go a lot higher maybe up to a couple of thousand lines – but that would be unusual – so I have set the array at 1000 lines. I might have up to about 20 classes on each sheet.
I have managed to solve the problem and get the data I require in the cells it require it by adding columns L and M. I didn’t realise that SUMIF does not work with INDIRECT(ADDRESS, as it does with INDEX (cell N6), so although, by adding the formula in column L at each heading I am able to find the line numbers for column M, I have to manually change the second line number of the SUM formula in column M.
To then get the right info into to quants columns of results columns (Q_Z) I also have to add a 1 on the heading line in columns F-J – when all I really want in columns F-J is the quantities from column C.
DESIRED OUTCOME:
To omit columns L & M and put the data directly into columns R, T, V, X, and Z – but at the very least, omit column M and make the formula in column L do the work.
Also, not to have to put a 1 in the heading line in columns F-J – which is currently used by the formulas in columns R, T, V, X and Z.
Bookmarks