LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Trying to find a way to calculate subtotals for different sections data validation

It's quite unusual to put multiple job estimates/invoicing on the same
form! That said, I advise you use different sheets for each!!

<quote1
"I want to go to A11 and select total. I want it to then display the
sum of F5:F10 in F:11 and G5:G10 in G11.
Then I select a new section in A12, it starts a new reference point for
the next total. The next total just adds F13:15 & G13:15"
</quote1

Later on you refer to these as 'subtotals' and so if that's indeed what
they are then use that term in your dropdown for reasons I'll explain
shortly.

<quote2
"Then in A17 I would select Grand Total and it would sum all of the
values in columns F & G. I now realize I would need to move the output
for the subtotals to different columns for that to work.

I need it to work like this because each invoice will have a different
amount of rows, and using the usual references won't work out for what
I'm trying to do."
</quote2

As suggested earlier.., using the 'usual references' won't work because
of the unconventional approach you're using. You do not need to move
the output for subtotals if...

<suggestions
Give col A a defined name with local scope...
"EntryType" (or whatever is meaningful to you!)

Give your headings row a defined name with local scope...
"HdrRow" (or whatever is meaningful to you!)
If that is row4 then make sure the RefersTo is "=A$1" when A2 is
the active cell.

Make your DV lists "Section,SubTotal,Total".

Select A2 and give it a fully relative defined name in the NameManager
window as follows...
Name: "LastCell"
Scope: sheet level
RefersTo: "=A1"
...so this name is reusable on all invoice sheets without name
conflicts.

Select "SubTotal" in A11;
In F11 and G11 enter this formula...
=SUMIF(EntryType,"Section",HdrRow:LastCell)
...so the 1st job is subtotalled.

Select "SubTotal" in A16;
In F16 and G16 enter this formula...
=SUMIF(EntryType,"Section",F$12:LastCell)
...so the 2nd job is subtotalled.
Note the use of the 'absolute' identifier ($) in the above formula. It
allows the col ref to be 'relative' to the cell containing the formula
so it auto-adjusts its col reference.

Select "Total" in A17;
In F17 and F18 enter this formula...
=SUMIF(EntryType,"SubTotal",HdrRow:LastCell)
...so the subtotals are totalled.

If you want this done via the Worksheet_Change event so it does the
totalling automatically when you select from the DV list then let me
know and I'll write some code for that.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find repetive data and calculate Ty Excel Discussion (Misc queries) 1 September 9th 09 09:52 PM
Sum sections of data Brian Excel Programming 3 August 6th 09 12:59 AM
HELP! Find Data in columns next to known data then Calculate Derro Excel Discussion (Misc queries) 2 January 25th 09 12:23 AM
data validation quick find Richard Excel Discussion (Misc queries) 9 September 22nd 07 01:44 AM
Data Validation / find & replace Penny Excel Discussion (Misc queries) 1 July 20th 05 08:45 PM


All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"