I am pretty new to excel and finding it a little tricky so any help would be appreciated!
I have a master sheet where data is going to be input by people. From this master sheet I have used IF statements to copy relevant columns to another sheet in the workbook. (not sure if thats the best way).
So when a new data row is input into the master sheet, this creates a new row in the other sheet because its displaying what has been input in the master. This is building up a sub-table so to speak. From this sub data (whether turned to a table or not) I want to create pivot tables.
Issues:
If the sub data is turned into a table, when new data is input in the master sheet the sub-table does not expand.
Trying it another way, without creating a table with the sub data I tried to create a dynamic range using OFFSET. However when an entry is deleted from the master sheet this creates a blank row in the dynamic range that is being used to create the pivot table.
Any help would be much appreciated! I've looked into OFFSET, MATCH, VLOOKUP and it's a little confusing although I do get the gist of what these functions can achieve.
Thanks in advance!
This particular combo is used to fiddle around with ranges, for example validations and complex lookups.
They will not help you with your issue.
The range expansion is triggered when new data is entered into an adjacent cell, not when its existing condition becomes recognizable.
The =OFFSET() is used to fiddle around with ranges.
The MATCH(...,0) finds the first match of your string, in your case the lack of string.
If you could in fact set up a Pivot table to indirect references this formula would be your solution:
=OFFSET(YourSheet!$A$1,0,0,MATCH("",YourSheet!$A:$A,0)-1,MATCH("",YourSheet!$1:$1,0)-1)
where A1 of YourSheet contains somthing like
=IF(IncrementalDataSheet!A1<>"",IncrementalDataSheet!A1,"")
I think I understand the problem you're having. If you have data in A:Z in Sheet1 and you only want to see columns A, T, and Y for example on your more visually appealing Sheet2, then the initial thought would be to put =Sheet1!A1 into A1 on Sheet2, =Sheet1!T1 into B1, and =Sheet1!Y1 into C1. Copy the range down as far as needed to display the data from Sheet1 and Bingo! A nice tidy summarized version.
But wait... If you delete a row from Sheet1, the referenced cell in Sheet2 now just displays #REF!... boo... that's no good.
So, instead of using direct cell references, you can make use of the INDIRECT function to make sure the values produced are always relative based on the address of the target cell.
In Sheet2 you would put:
A1 =INDIRECT("Sheet1!"&(CELL("address",A1)))
B1 =INDIRECT("Sheet1!"&(CELL("address",T1)))
C1 =INDIRECT("Sheet1!"&(CELL("address",Y1)))
And copy down. At first glance it looks just like the original result, the difference is you can now delete rows from Sheet1 without hurting the output on Sheet2 because the indirect references will just look up new values from where everything shifted.
You should then be able to pivot off of the result dataset pretty easily.
That said... when you make a pivot table you pick which columns you include, so you could just pivot off of the original giant table and exclude any columns that you're not interested in summarizing.
Related
I'm hoping someone can help me make better use of the INDIRECT formula.
I have a list of sheet names in a table and an INDIRECT formula that uses that list to return a value in a specified cell - the list of sheet names is just an easier way for me to drag the formula down the table and read the appropriate cells without having to manually link each sheet.
=INDIRECT("'"&A2&"'!"&"K10")
This works fine for single cells as the range ref is simply stated as the text in the formula (K10), the problem arises when I need to start referring to a range such as K10:K15 and summing the values.
The range K10:K15 will inevitably have new rows added or deleted on the relative tab and as INDIRECT is using text as the reference it means the range doesn't automatically adjust - this is as I understand it one of the 'benefits' of INDIRECT but in this case is actually holding me back.
Also worth noting that the range (K10:K15) may move as rows are added/deleted above this, as this range is part of a larger table.
In simplistic terms I want to achieve the same result as a standard reference to a range on another sheet, e.g. =sum(sheet1!K10:K15) (as this will adjust when rows are added/deleted) but I just want to be able to dictate which sheet is referred to via a list I have in a table on a summary sheet.
How do I either write INDIRECT so the range adjusts when new rows are added/deleted or is there a different formula I should be using that achieves this?
Any advice greatly appreciated :)
=INDIRECT("'"&A2&"'!K"& MATCH(TRUE,INDIRECT("'"&A2&"'!K:K")<>"",0)&":K"&MAX((INDIRECT("'"&A2&"'!K:K")<>"")*(ROW(INDIRECT("'"&A2&"'!K:K")))))
This indirectly references the rows from the first non empty cell up to the last non empty cell in given sheet in column K. Not sure if you need to enter with ctrl + shift + enter (not in the app version).
Note: If the range contains empty cells in between the first and last non empty cell it will be included as value 0
Or in office 365 use the following:
=FILTER(INDIRECT("'"&A2&"'!K:K"),INDIRECT("'"&A2&"'!K:K")<>"")
I'd like to fill every other row in an excel worksheet with the value that is following that row.
See example.
Is there a way to accomplish this?
I am sorry if this is an extremely easy task, but I just can't get my head around how this may work, since just plain copying the data, filtering for blank rows and pasting it into the filtered table just doesn't work as I want it to.
Thanks in advance.
Edit: It might be worth adding that I cannot at all change rows or columns in the excel sheet since it is connected to a database which configuration does not allow this.
Add a new helper column with the formula =ISEVEN(ROW()).
Filter this column on TRUE.
Select the range from A2 to the bottom-right of the cells that you want to populate, and input =A3 [Ctrl-Enter].
Clear the filter and delete the helper column.
I have no coding experience, just trying to pull together a function within a spreadsheet at work to save everyone a lot of time - would be great if anyone could help me!
So I have an excel workbook, which has multiple columns of values within one sheet, which I would like to copy across to another sheet. But I only want to copy specific columns, dependent on the presence of a value in a different column for each row.
So for example:
Sheet 1
So I'm looking for a way to check for the presence of ANY value (ie just not an empty cell) in column C, and if there is a value present in column C, to then copy the values from columns A and B into a separate sheet in the workbook. I would need it do this check for each row within sheet 1 and copy them all as separate rows into sheet 2.
Is this possible?? Ideally without the use of VBA as I have a feeling adding this in to an already shared workbook may slow it down to the point of not being able to be used?!
Thank you!
Assuming Sheet1 is as follows
Then in Cell A1 of Sheet2 enter the following formula
=IFERROR(INDEX(Sheet1!C$1:C$5,SMALL(INDEX(NOT(ISBLANK(Sheet1!$C$1:$C$5))*ROW($C$1:$C$5),0),COUNTBLANK(Sheet1!$C$1:$C$5)+ROW($C1))),"")
Drag/Copy down and across (to right) as required. Change range as per your data. See image for reference.
I have this table that is made from reference to other table.
and now I want to sort from small to largest the third column, but since it is referenced from another table is not sorting. And I also dont want excel to sort the reference table and I need the table to be referenced because I will change some values on the reference table and I need them to be connected, so I just cant copy and paste the values and then sort.
Could you give me some help?
Ok, I went ahead and built a small example:
The formulas are as follows:
The 3 in Row 20 are to be copied downwards with PasteSpecial>Formulas:
in E20: =IFERROR(RANK($D20,$D$20:$D$33,1),"")
in F20: =IF(ISNUMBER($D20),"",(COUNTIF($D$20:$D$33,"<"&$D20)+1)+COUNTIF($D$20:$D20,$D20)-1)
in G20: =IF($E20="",(MAX($E$20:$E$33)+$F20),$E20)
The formula in B3 is to be copied into the whole target table with PasteSpecial>Formulas:
in B2: =INDEX(B$20:B$33,MATCH(ROW()-1,$G$20:$G$33,0),1)
Please let me know if you have any questions!
This method only works if the entries in the column you are sorting on are unique. You will need to adjust the address ranges to suit your data.
The formulas in the each column start from X and finishing in Z as you move left are as follows:
=INDEX($X$41:$X$47,MATCH(ROWS($Z$29:Z29),COUNTIF($Z$41:$Z$47,"<="&$Z$41:$Z$47),0))
=INDEX($Y$41:$Y$47,MATCH(ROWS($Z$29:Z29),COUNTIF($Z$41:$Z$47,"<="&$Z$41:$Z$47),0))
=INDEX($Z$41:$Z$47,MATCH(ROWS($Z$29:Z29),COUNTIF($Z$41:$Z$47,"<="&$Z$41:$Z$47),0))
Note only the range right after INDEX is changing. Thes are CSE or array formulas. It means you need to press CONTROL+SHIFT+ENTER when you are done editing your cell. Then copy the individual cell and paste it in the rows below the copied cell. pasting including the source cell or dragging down MAY not work. Repeat this for all three columns.
Proof of concept
In Excel 2007 I use the following formula to refer to cells in other worksheets in the same workbook:
=INDIRECT($B$2&"!A9")
B2 contains the name of the worksheet containing the target cells (I want to turn this into a template, so I don't enter the name into the formula). The formula works, but I want to use this same formula over multiple rows (A10, A11, A12 [...] A1000). I am using this same code over multiple rows but with different fields (B9, C9 and so on), with a variety of different content types (data, number, text).
An alternate version of the formula is as follows:
='Worksheetname'!A9
But again, this requires hard-coding the name of the worksheet, which is not desirable for me.
Because of the sheer volume of the rows manual editing is not an option: is there any way to alter this formula so I can easily use it over multiple rows? Preferably without the use of VBA, but that is not a requirement.
If your records are located in the same cells in both worksheets, then you can use something like following:
=INDIRECT($B$2&"!"&ADDRESS(ROW();COLUMN()))
IF now, then you can easily offset them using given ADDRESS function
P.S. Please be aware with INDIRECT function that it slows down calculation performance on your workbook (few functions are OK, but if you have 10,000 of them then you might see some delay)
If you want to use the same formulas for several columns as well you could include something like this:
=INDIRECT("'"&$B$2&"'!"&ADDRESS(MATCH($B4;INDIRECT(CONCATENATE ($B$2;"!";"B:B"));0);MATCH(B$3;INDIRECT(CONCATENATE($D$2;"!";"A3:AR3"));0)))
B2=reference to sheet name
B4=first row for your data
B3=Column header
For those who want to pull all the same column of data from multiple sheet that have the same layout (and have each cell linked), it took me hours to work it out, but actually can be solved with a relatively simple way:
=OFFSET(INDIRECT("'"&G$2&"'!l7"),$A6,0,1,1)
The Indirect part take you to the right sheet and right cell, G2, H2 ... has the Sheet names (be mindful of sheet name with space, you will need to use ' ', which is the case for my workbook), and L7 cell of that sheet, and I want L8, L9, ----L200 all being pulled through;
Offset help you navigate the range of rows, A6 is an additional numbering row I added to move to the right row in each sheet.
Hope it help!