I'm sure this question has inevitably been asked and answered but despite a couple of days of searching I haven't been able to come up with a solution.
In excel (2010) I have a section of data referring to test results. The data looks roughly like this:
Each run inserts a new line at the top (row 2) with the latest results. From this I am trying to produce a chart that shows only the results from the last 7 runs, so the data in B1:E8. I can do by either direct reference, named range or converting to a table. The problem with the first two methods are that when I insert a new line under the headers the range then splits so that I have B1:E1 and B3:E9. The table method is slightly better in that it includes the newly inserted row but keeps the range set to the same bottom row (so it ends up referencing 8 rows of data).
Am i missing something obvious here? I'd prefer the data to be listed like this with the newest on the top, but I'm sure I can change it so the newest is at the bottom if anyone has a good idea!
Thanks in advance!
You can use INDIRECT formula on another worksheet to capture part of your table from Sheet1, like this:
=INDIRECT("Sheet1!B1:E8")
And then specify that as your chart data range.
Just remember to use INDIRECT as array formula:
Enter =INDIRECT("Sheet1!B1:E8") in Sheet2!B1 cell.
Select B1:E8 range.
Press F2 and then Ctrl-Shift-Enter to make it an array formula.
I would use a Pivot Chart.
You can apply a filter on these charts to only look at the Top X results. So if you filter to show Top 7 by Date, then this should do the trick.
You might need to lookup a quick tutorial on Pivots and Pivot Charts if you don;t have any experience though.
They are incredibly valuable though, so I would recommend it regardless.
Related
I've a question regarding columns and finding non zero values with there labels.
Hopefully the pictures will make my problem/struggle a bit better to understand.
Basically, there are columns to the right that show labels and hours that a team loaned in or out.
The values are found through a formula that shows per label the totals amount of hours spent.
Now I want to have on my overview page the two columns to the right with only labels showing the labels that contain hours. I've tried to use multiple if variables but that didn't seem to work :(
So at the end it should show something like this (I now manually typed the labels and data):
I did a quick recreation of your data structure to test this.
Using Array Formulas should get you the desired results in the current structure of your worksheet:
For range Loaned in you'd need the formula to be
=IFERROR(INDIRECT(ADDRESS(SMALL(IF($I$4:$I$14>0,ROW($4:$14),""),ROW(A1)),8)),"")
Where 8 is a reference to the return column. For the range directly to the right, you'd use the same formula, just adjust 8 to 9. And for range Loaned Out you'd need
=IFERROR(INDIRECT(ADDRESS(SMALL(IF($K$4:$K$23>0,ROW($4:$23),""),ROW(A1)),10)),"")
And for the range directly to the right you would again change the 10 to a 11. Again, both of these are array formulas, so they have to entered slightly differently. See the link for further assistance with array formulas.
This is not trivial. If you cannot work with filtering or programming, you should make use of matrix formulas. I include an example with two formulas: 1st in D1:D5, 2nd in F2:G5. Enter them with Ctrl+Shift+Enter. Also, you should use an extra column to determine the "valid" rows. (You could put it all in one formula, but it would look even more complicated.)
Sorry for German excel. Wennfehler = iferror, kkleinste = small, zeile = row, wenn = if, bereich.verschieben = range.offset.
I'm fairly new to excel but have been learning lots. Please go easy on me.
Have 30,000 pieces of data, and constantly filtering this data set. As such, all my formulas constantly need to be updated to the new range (for example, a filter may change my range from B7000:B9000 from B1:B30000). I was able to make it so I can retrieve the row numbers for the first and last visible column.
I was hoping to be able to reference this within my cells to expand my range. What I tried (just as an example),
=INDEX(Helper!D3:Helper!E3),MATCH... (rest of the formula is correct)
In the Helper Spreadsheets for D3 I have
=Concatenate("'Sheet 1'!U"&D2)
Where, D2 is the formula I have used to grab my first visible row. In this case my D2 displays 7000
Is this doable or am I totally approaching this wrong? I've seemed to hit a brick wall and I can't figure out how to get this to work. Thanks again.
EDIT:
I am trying to use index and match on a range of cells to populate a fairly large table. Problem is range keeps changing every time I filter data. So I have 30 iterations of this data I need to get through in an already fairly complex algorithm i'm running. I was hoping to save a few steps by having my formulas auto expand depending on the filter, which would save me lots of headache as right now I have to go through and edit each formula by hand to the range the filter sets.
I thought I had it figured out by getting a way to grab the 1st and last visible column, however now I can't enter those into a reference as a formula for example as in the case above.
I'm stuck on an Excel problem and am hoping someone can assist. I read through 10-15 topics that are similar, but I wasn't able to get anything to work. Here is where I'm at...
I have a large data set containing columns for Year, Name, Total 1, Total 2 (and 20+ other columns). The same names appear in multiple rows based on the yearly totals. On a separate sheet, I have another data set containing Name and would like to pull the data from sheet one into columns as shown below.
I have done this in the past using only one year as the initial data set with the following formula:
=INDEX(DATARANGE,MATCH([#Name],DATARANGE[Name],0),MATCH("Total 1",DATARANGE[#Headers],0))
The problem I am having is the result of adding multiple years of data to my 1st data set. Is there a way to match the row based on name and year and then return the results of the appropriate column?
=SUM(($A$2:$A$9=B$16)*($B$2:$B$9=$A17)*($C$2:$C$9))
Enter above in cell B14 as an array formula or below as standard
=SUMPRODUCT(($A$2:$A$9=B$16)*($B$2:$B$9=$A17)*($C$2:$C$9))
You can do the same for total 2 just replace Cs with Ds
And then drag right and down.
Change the first MATCH function to something like this:
=MATCH(1,INDEX(([#Name]=DATARANGE[Name])*([#Year]=DATARANGE[Year]),0),0)
so as part of your whole formula that would be this
=INDEX(DATARANGE,MATCH(1,INDEX(([#Name]=DATARANGE[Name])*([#Year]=DATARANGE[Year]),0),0)
,MATCH("Total 1",DATARANGE[#Headers],0))
Another way you can use for returning numbers only (as here) is like this: (with cell refs for simplicity).
=SUMPRODUCT((A2:A9=2013)*(B2:B9="name x")*(C1:D1="Total 1"),C2:D9)
If the presented data to be indexed is a table then
This
=MATCH(1,INDEX(([#Name]=DATARANGE[Name])*([#Year]=DATARANGE[Year]),0),0)
should be corrected to a proper structured reference of
#[Name]
Also since this is an array formula it may not work with structured references at all. You'd be better served with regular cell references. Also if it is not a table only cell references will work.
While i have seen this topic answered before i cant seem to understand the solution :(
Here is my worksheet:
https://docs.google.com/spreadsheet/pub?key=0AsCQyX3EZ40SdC1FNFBjVDh6d01iY2g0WnVXOU5GeFE&output=xls
As you can see i need the second INDEX in the first sheet to return the second value looked, but instead (as expected) it shows the first one again.
I am not the best with excel, explain slowly and i will understand fast!
Thanks in advance!
Try this "array formula" in Calculator sheet cell A3
=IFERROR(INDEX(IngredientDB!B$1:B$100,SMALL(IF(IngredientDB!$A$1:$A$100=$B$1,ROW(IngredientDB!$A$1:$A$100)),ROWS(A$3:A3))),"")
confirmed with CTRL+SHIFT+ENTER and copied across and down. When you run out of entries you get blanks - assumes up to 100 rows of data, increase as required
If you wanted to go the pivot table route you can start with this as a base and then customize it to your exact liking.:
Start with your info:
Then add a pivot of your data:
Then set the properties as so and then you can select the search terms, you can also change the settings to allow someone to type it in also:
The result will be as so:
First time question and I hope it's easier than I'm making this.
Can I use a variable inside a COUNTIF formula?
Currently my formula is:
=COUNTIF($C$2:$C$415,R6)
I would like to have $415 as my variable. I have tried something along the lines of:
D1=415=COUNTIF($C$2:$C$(D1),R6) ..
but obviously get a error.
The reason I need this is column C will constantly be incrementing as I add more rows.
Instead of going into each of my formulas and updated 415 to 416, 417 etc, I would like to just define a Cell that can be my variable, or total rows.
Currently Column C can have blank cells, so I can't have a macro that finds the next empty cell.. but I do however have Column A with a constant populated cell and stops at the last ticket. However Column A is unrelated to the COUNTIF.
UPDATE 1
I'd also like to mention that I'd be using this variable in many formulas in the spreadsheet. Not only COUNTIF's. Also, the COUNTIF contains text.
UPDATE 2
Actually, I figured it out! I am using this formula instead:
=COUNTIF(INDIRECT("C"&D1&":A"&D2),R6)
I'm putting D1=2 and D2=415 and will just update cell D2 with how many rows I have.
I guess I just needed to ask the question thoroughly to fully understand what I wanted!
Thank you in advance for all help, tips and suggestions.
Would "=COUNTIF($C:$C,R6)" do the trick? This will apply COUNTIF to the whole of column C. It's an easy solution, but probably not the most efficient.
I prefer tables for storing data; as new data is added, the table automatically expands and the columns are already labeled (much like Named Ranges). Then you can have =COUNTIF(Table1[Column1],"Criteria"), which will encompass any new rows added to the table automatically. Especially helpful if you have multiple tables in the same column.