Excel: How to display more information when using Subtotals? - excel

I am looking for a way to show additional information (columns) when doing subtotals beyond the columns that you are using On Change and are doing a function to (sum, min etc).
A simple example, I have the following data, which has 5 columns of information:
Zip Code Media Sunday Zip Code Circulation
3082 Bluebell 3,456,284 551
4418 SuperCoups 632,161 1,437
3221 AJ Direct 6,777,636 1,015
3240 AJ Direct 6,777,636 554
3768 AJ Direct 6,777,636 712
3774 AJ Direct 6,777,636 824
4219 Target Marketing 7,256,964 655
4418 Target Marketing 7,256,964 703
4434 Target Marketing 7,256,964 506
Normally we would want to use the subtotal feature to sum up the zip code circulation for each Media program. The problem, when we do this, the sub total view only shows the media name, and the summed up zip code circulation. On this summary view, I would also like to show the fields that also do not change, such as the Sunday circulation. Of course we can click on the + field to expand to show the details, but I'm looking for way to show additional columns of data that are not changing on the summary view.
Any idea how to do this?

Can't you just change that sum type for that column to MAX or something like that? If the data for the every row is the same (for your subtotal/summary), then using an aggregate type like that might do what you're looking for.
UPDATE: It looks like there's no front-end way to aggregate two different ways at the same time (MAX on C, SUM on D), so here's what you do:
Create the subtotals as SUM on C and D when B changes
Highlight column C
Do a Find-Replace and replace "SUBTOTAL(9," with "SUBTOTAL(4,"
This will switch the SUM aggregates in that column to be MAX instead, which is what you're looking for. I've asked someone who ought to be an Excel MVP, and he said there's no way to do this without modifying the formula afterwards.
Hope this helps!

Have you tried pivot tables?
You can add columns that contain additional 'formulas' too, using Calculated Fields or Calculated Items.
Bill

The easiest way to achieve this is to concatenate all of the required info into a single cell and use that as your "For each change in" column.
So if Zip Code was in column A, Media in column B and Sunday in column C then you could insert a new column as column A which would push the original three columns over (to B, C and D respectively). If you use this formula in A2:
=B2&" "&C2&" "&D2
and then autofill downwards you should now be able to get the desired info when using subtotals. It doesn't look very good but it's quick and easy
(The real problem is that your data is not normalised)

Related

SUMIF with Index and multiple match criteria with Dynamic range

enter image description here
In the above problem, I am trying to create a dashboard of Brands Category wise.
The formula i am trying is. THis is in google sheets.
=INDEX($A$1:$F6,ArrayFormula(MATCH(A$12&B12,$A$1:$A6&$B$1:$B6,0)),Match(to_text(C$11),$A$2:$F$2,0))
THis returns only 1 value . But I would like to get a sum of BrandA, Catgory1 both in Nos and Pcs. How do I go about doing it? Somehow, not able to work with SUMIF. what is best suited?
Actually trying to create a dashboard for Month wise Sales/Purchase data like the link below. Any better way of doing in?
https://docs.google.com/spreadsheets/d/1047uWOrOqkW3L_1hoKh-MaY-O0_CZC0WiqmV8HZqk6o/edit?usp=sharing
Raj, if I understand your question, the following formula might provide the result you want.
=QUERY(Data!A1:F,"select A,B,sum(D),sum(E),sum(F)
where A<>'' group by A,B order by A,B
label sum(D) 'Apr',sum(E) 'May',sum(F) 'June' ",1)
This queries your data, groups it (and sorts) by brand and category (ignoring the Unit type) and sums the values. It also modifies the header text for the three summed columns.

Count categories changes in Excel

I have specific problem which is best described by a picture.
E1:G10 are rules for categories e.g. change from cat C to C will cause 1 hr delay.
There are products which fall into category of a products A, B and C. Next to it you can find quantities of which they are produced.
f you want to rebuild machine from cat. A to B etc. it will cost you time (ruling is described next to it).
I need to find a way how to determine time of rebuild. I did it manually and you can see it column C. However, I wish Excel would do it automatically. Later I am using data in solver.
Does anyone know solution to my problem?
Thanks in advance.
I would use the formula sumifs.
For example the first category "C" with 1000 parts will change to category "A":
"=sumifs(G:G, E:E, A2, F:F, "A")"
I would also suggest you to put additional column with target category change and implement it to the formula.
Hope it helps.

How do I calculate a Sum based on multiple If's in Excel?

Background is that I'm making a budget spreadsheet. I have different bills due on different days. (ie. bill due on Monday and bill due on the 10th)
I want a function that will place the appropriate amount of money going in/out in column D and the description of why the money is going in/out in column E.
Currently I have two different formulas that I created (probably incorrectly).
Formula for Column E: (Already is in the document and seems to work fine other than that fact that I cant add additional text to the cell)
=IF(DAY(C36)=7," Amy Pay","")&IF(DAY(C36)=22," Amy Pay","")&IF(DAY(C36)=8," Family Bills","")&IF(DAY(C36)=6," Dollar Shave Club","")&IF(DAY(C36)=2," Amy Cap One VISA","")&IF(DAY(C36)=3," Chase VISA","")&IF(DAY(C36)=8," Being Smart","")&IF(DAY(C36)=17," Gym","")&IF(DAY(C36)=11," Netflix","")&IF(DAY(C36)=19," Cap One MC","")&IF(DAY(C36)=29," CenturyLink","")&IF(DAY(C36)=6," Haley Cap One Visa","")&IF(DAY(C36)=10," SRP","")&IF(DAY(C36)=23, "Car Payment","")&IF(DAY(C36)=30, "Rent","")&IF((B36)="Mon"," Monday","")&IF((B36)="Fri"," Friday","")&IF((B36)="Fri"," Haley Pay","")
Formula for Column D: (not in the column yet, as it doesn't work how I want)
=IF(DAY(B40)=7,"1474.22","")&IF(DAY(B40)=22,"1474.22","")&IF(DAY(B40)=8,"-100","")&IF(DAY(B40)=6,"-9","")&IF(DAY(B40)=2,"-100","")&IF(DAY(B40)=3,"-100","")&IF(DAY(B40)=8,"-400","")&IF(DAY(B40)=17,"-20.05","")&IF(DAY(B40)=11,"-8.63","")&IF(DAY(B40)=19,"-450","")&IF(DAY(B40)=29,"-50","")&IF(DAY(B40)=6,"-150","")&IF(DAY(B40)=10,"-200","")&IF(DAY(B40)=23,"-325","")&IF(DAY(B40)=30,"-500","")&IF((A40)="Mon","-125","")&IF((A40)="Fri","-325","")&IF((A40)="Fri","400","")
http://imgur.com/IBINweh
      
The problem is that in column D, rather than providing a sum of the numbers, it lists the numbers in the column.
http://imgur.com/rPDS5h2
      
I had a suggestion to add =SUM( in front of the IF( function, but when I do, #VALUE! is what results in the field. Using this formula: (view image by changing appended text to /CVs0f1v )
=SUM(IF(DAY(B40)=7,"1474.22","")&IF(DAY(B40)=22,"1474.22","")&IF(DAY(B40)=8,"-100","")&IF(DAY(B40)=6,"-9","")&IF(DAY(B40)=2,"-100","")&IF(DAY(B40)=3,"-100","")&IF(DAY(B40)=8,"-400","")&IF(DAY(B40)=17,"-20.05","")&IF(DAY(B40)=11,"-8.63","")&IF(DAY(B40)=19,"-450","")&IF(DAY(B40)=29,"-50","")&IF(DAY(B40)=6,"-150","")&IF(DAY(B40)=10,"-200","")&IF(DAY(B40)=23,"-325","")&IF(DAY(B40)=30,"-500","")&IF((A40)="Mon","-125","")&IF((A40)="Fri","-325","")&IF((A40)="Fri","400",""))
Any ideas on how I can get all the to populate and sum appropriately?
Forgive my Non Excel Guru knowledge - trying to learn. :D
-Amy
If you take all of the options from your first working formula and change the method retrieving them, you will have a much more versatile worksheet that can easily accept new additions and schedule modifications.
    
In a couple of unused columns to the right, pit in the day-of-month and the action that occurs. I'm using columns Y & Z. You have two events occurring on the 6th so I put them together.
In a couple of other unused columns use the day-of-the-week and associated text.; I've used columns V & W. The default for Sunday is 1.
In E36 use this formula,      =TRIM(IFERROR(VLOOKUP(DAY(C36),$Y:$Z, 2, FALSE), "")&" "&IFERROR(VLOOKUP(WEEKDAY(C36),$V:$W, 2, FALSE), "")) 
Fill down as necessary.
If you want the day-of-the-week in column B, use =C36 and use a custom number format of ddd or dddd.
References:
  VLOOKUP function  WEEKDAY function
You are concatenating text strings that look like numbers. You probably want to be adding real numbers:
=SUM(IF(DAY(B40)=7,1474.22,0) + IF(DAY(B40)=22,0) + ...
although, whenever I see a formula as complex as what you have, I would consider looking for a different solution -- Vlookup comes to mind.
In addition, with a VLOOKUP table, you would have seen that you have some conflicts -- e.g: you list the same condition of B40=8 to return two different values; and the same condition of A40 = Fri, to also return two different values.

VLOOKUP query help required - count from a range

I'm trying to build a spreadsheet to help automate points scoring for an office F1 fantasy league we have.
I've attached an example data set, but basically I need to search a range, then count how many times the constructor appears in the numbered positions (discounting R, D as they've not finished), then carry this over to the standings.
I also need to do something similar for the top 10 which says if 2 cars from the same constructor (Mercedes, Mercedes) appear in positions 1-10 then add points to the standings.
In the working model the data for race1 is direct from the BBC via web query, so how they appear with 'driver' in between is how it must remain (I also have other actions running which lookup the driver info, so can't be moved).
I've popped the example on my drive here and updated version.
You need to be consistent with spellings or this won't work, but for standings B2 you might try:
=IF(COUNTIFS(race1!C:C,A2,race1!A:A,"<>D",race1!A:A,"<>R")=2,20,IF(COUNTIFS(race1!C:C,A2,race1!A:A,"<>D",race1!A:A,"<>R")=1,7,-15))
and in C2:
=COUNTIF(race1!$C$2:$C$11,A2)*10
both copied down to suit.
Edit for number of cars in column B change first formula to:
=COUNTIFS(race1!C:C,A2,race1!A:A,"<>D",race1!A:A,"<>R")
and for points put first formula in C2 (copy both down to suit).

using conditional named range in excel

Let me try this again, I've been searching the web and can't seem to find anything. What i'm trying to do is in excel have a bunc of named range list conditional based on a value of another cell. The problem I'm running into character limit when I setup the data validation and put all my IF statements in source textbox. If i just put two conditions it seems to work fine, but that won't work for me. Here is my example data, based on the B column value I want to display the valid sub-items for it. Like I mentioned I have 20 or so different possible values that could be in column B.
B C
1 ENG dropdown of all engineering sub-categories
2 PRO dropdown of all production sub-categories
3 PER ...
4 PAY
5 ENG dropdown of all engineering sub-categories
6 ENG dropdown of all engineering sub-categories
When i try to setup my data validation list on column C1, I put in the following...
=IF($E$5="CAR", CA,
IF($E$5="DCC", DCC,
IF($E$5="ENG", ENG,
IF$E$5="ENV", ENV,
IF$E$5="FBI", BI,
IF$E$5="FGL", GL,
IF$E$5="FAP", AP,
IF$E$5="FRE", AR,
IF$E$5="FTX", Tax,
IF$E$5="ORM", OAR,
IF$E$5="PAY", PAY,
IF$E$5="PIR", PER,
IF$E$5="PRO", PRO,
IF$E$5="PUR", PUR,
IF$E$5="RSK", RM,
IF$E$5="SLM", Sales,
IF$E$5="WFS", WAR)))))))))))))))))
I'm only able to type in maybe half of my IF condition. I tried VLOOKUP but that only allows for 1 value to be put in column C, and I want it to be a dropdown. Any help would be much apprecriated.
You can do this in a much shorter formula by combining VLOOKUP and INDIRECT:
Have you list of of potential names in column B and their corresponding range names somewhere in two columns, e.g. column X & Y:
Col X Col Y
CAR CA
DCC DCC
ENG ENG
ENV ENV
FBI BI
...
Then use the following formula as the source of the list in the Data Validation:
=INDIRECT(VLOOKUP($E$5,$X:$Y,2,0))
Actually, with this approach you can potential even save the effort of naming and maintaining the manual range names! Instead, just replace the name of the named range with the real address - which - with a bit of luck and smart formula engineering - you can derive automatically. This depends on your data structure, but most likely the functions ADDRESS, COUNTA, OFFSET, INDEX and MATCH will be helpful.
E.g. if your lists would be stored in another worksheet with the name of the list in the first row and the elements listed below each header, this example file will provide you the example formulas. One step further, it'll also use conditional highlighting to mark any entry that is invalid, e.g. because the type was changed after the selection:

Resources