How to do Totals where the start and the end of the array can vary?

Rafaa

New Member
Joined
Aug 29, 2013
Messages
23
Excel 2010
ABCDEFGHIJKLMNOPQR
1Project Budget
2
3Project Name:
4Nickname:
5Reference:
6
7IDProject ExpensesJan-13Feb-13Mar-13Apr-13May-13Jun-13Jul-13Aug-13Sep-13Oct-13Nov-13Dec-13 Total
8 $ -
9HeaderArtwork $ -
10ArtworkManual - User $ 100.00 $ 100.00
11ArtworkManual - Service $ 255.00 $ 255.00
12ArtworkLabels $ 151.00 $ 255.00 $ 406.00
13ArtworkCarton $ 255.00 $ 255.00
14HeaderTotal $ -
15 $ -
16HeaderDevelopment Samples $ -
17Cert_GasSpecification $ -
18Cert_GasLab Testing $ -
19HeaderTotal $ -
20 $ -
21 $ -
22 $ -
23 $ -

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
template



Hi,

I am trying to have an adaptable template for a product development budget spreadsheet where I can insert specific costs for each stage of the process. The idea is to avoid having a big list of all possible costs and then having to delete unused rows, instead we would have a blank template where we select the type of costs we want to include on the table.

The columns "ID" and "Project Expenses" have drop down lists. Each specific ID selected on the "ID" column provides a different range of options to be selected on the adjacent cell under the column "Project Expenses" and If I want to include artwork costs starting on cell D10, for example, I select "Header" ID on cell B9, then I select "Artwork" on cell D9, then select "artwork" ID on cell B10 and then select "Manual user" on cell D10, repeating this process until we get to the stage presented on the sample above my message.

The problem now is how do I do to have the partial total for each type of header? How do I use conditionals to insert the sum function only on the rows where "Total" was selected on the "Project Expenses" column and how do I define the start and the end of the arrays? For instance, the total costs of Artwork in JAN (cell F14) should be the sum from F10 to F13.

Please let me know if it is clear and if not, I can try to explain in a different way. Thanks in advance! Any help would be entirely appreciated.

Cheers,

Rafaa
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I think you're going to have to use a worker column here.

I would use column C to calculate how many entries are under each header.

In cell C9: =IF(D9="Total",COUNTIF($B$9:B9,B8),"" )

Then copy that down.

In cell F14 you can then have =SUM(OFFSET(F14,-1,0,-$C14,1))

Then copy that across. Of course, you can put the COUNTIF function into the formula directly, but that will become computationally intensive if your sheets get big. So it's up to you.
 
Upvote 0
Thanks for your reply Glove_Man, but the problem is that after row 8 the table is created differently for each project. What I am trying to find is a way to count the totals between two "Header" IDs.

I don't know how, but when a row is selected to be the Total, I would need to search for the previous "Header", locate its row and then stipulate the start and end of the SUM function. I can't address the array to specific cells as it can be changed. For example, I could have listed the costs for the "Development Samples" before the "Artwork" costs.

You can't see it on the example that I showed, but the costs IDs aren't necessarily all the same for each header. For example, I could have under "Development Samples" Cert_Gas and Cert_Elect as type of costs. So the way you presented to count the entries won't really work in this case. Thank you anyway Glove_Man.
 
Upvote 0
Shifting the Goal Posts!!!

But, I think we can come at this another way.

This formula is an array formula, so you need to use Ctrl+Sht+Enter.

In cell C10 =MAX(IF($B$1:B10="Header",ROW(B1:B10),0)) You should be able to copy this down and get the row number of the most recent "Header" other than the row you are currently in.
 
Upvote 0
Hi Glove,

Thank you for your assistance. Using your first post, I sort of found a way around, I just need to make sure that all the ID are the same under each header, then I can use the COUNTIF the way you suggested.

For the total formula (Cell F14), I did as follows:
=IF(INDIRECT("D"&ROW())="Total",SUM(INDIRECT(CHAR(COLUMN()+64)&ROW()-INDIRECT("C"&ROW())):INDIRECT(CHAR(COLUMN()+64)&ROW()-1)),"")

So I can place this formula anywhere and I won't have problems.

Now I need to learn how to populate cells with that formula using the condition of the cell on column D being "Total", but for that I believe I will need VBA, won't I?

Thanks a lot!
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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