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.
Related
I have an Excel file with three sheets, with data in each sheet organised in the same manner - headers are the same.
Without using VBA (as macros are not allowed by my organisation's security policy), I would like to find all rows from all sheets that meet a simple column value check and show those rows in a separate sheet.
For example:
Sheet2 has,
Sheet3 has,
Sheet4 has,
I want sheet1 to have all rows from sheets 2-4 with Header7 column value = "Hit",
What I have achieved so far is, using an array formula I could get all the "hits" from one sheet in sheet1.
The formula for A2 to A6 in sheet1 is as below, with the ROW(1:1) changing to ROW(2,2) and so on from A3 onwards. Columns B to G use the same formula with range adjusted accordingly.
{=IFERROR(INDEX(Sheet4!$A$2:$A$6,SMALL(IF(Sheet4!$G$2:$G$6="Hit",ROW(Sheet4!$A$2:$A$6)),ROW(1:1))-1,1),"")}
What this does is a bit complicated. In short, it creates an array of either FALSE or row numbers based on Hit and then finds the index of the non-false values.
Now, I can solve the last part of combining the idea to include all sheets in two ways (I think).
Have another temporary sheet (sheet5) with all rows from sheets 2 to 4. Update my formula in sheet1 to use sheet5 instead of 4.
Have the range Sheet4!A2:A6 etc changed to include a 3D reference like Sheet2:Sheet4!A2:A6. But this doesn't work, and the documentation for 3D reference doesn't mention that it works with array functions.
PS: I don't have Power Query, which seemed to have an easy way to create a new sheet with all rows from multiple sheets, because I work on a Mac (MS Excel for Mac).
I have looked for this answer but haven't found anything that has worked so I apologize if this is a duplicate question.
I am using Excel 2010 and have two sheets within one workbook. The first sheet holds the majority of information regarding individual members and is where I am using the formula. The second sheet holds data regarding each members' usage. Each line represents one individual. I am trying to gather all of the instances for one individual listed in sheet two and place it in a cell in sheet one.
I have used the sumif function which works perfectly for the first individual I use it on. After that, dragging the box changes both the range and sum_range of the formula along with the criteria. I want the criteria to change to the cell in the next row but I need the range and the sum_range to remain the same for every cell. If I copy the formula from the first cell and paste it into the second row, nothing changes.
Any ideas as to how I can make the sumif formula work over the entire column without changing the range and sum_range? Or is there an easier way to do this? Please keep in mind, the second sheet will expand over time to include more and more instances which will need to be included in future calculations.
Lets say your range is A1:A3 so to completely lock it just change it into $A$1:$A$3.
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.
I'd like to know if it is possible to link two sheets so that if I add a row in one sheet it autmatically gets added to the second sheet.
Thanks.
Not exactly -- I'm pretty sure you can't link an entire sheet. But you could use formulas with cell references, e.g. =Sheet2!B2 refers to cell B2 from Sheet2.
You could also try the vlookup() formula function. If you have a table defined somewhere in the workbook, you can use this function to return the value from one column of the table based on the supplied value from another column in the table.
You can "Group" sheets together by holding down CTRL and selecting the tabs of the sheets to be grouped. Adding and deleting rows and columns would result in the same treatment over all the selected sheets. But this is temporary and is lost as soon as another sheet is selected or the file is closed.
For a longer term entanglement, you would need VBA code.
I have 5 sheets in my Excel file. Out of these 5, one is the master sheet which has all the data I want to copy to the other 4 sheets.
All the sheets have one common column, ID. The master has more than 10000 IDs.
What I want to do is:
If ID in sheet1 = 24356 = ID in master sheet then copy x, y, z columns from master sheet to sheet1. This is same for all other sheets.
Also, since the master sheet is from other source than the rest of the sheets, its formatting is different. Is there a way to remove all formatting in sheets before running copy/paste?
Can anyone please tell me the VBA code to do this.
This is how my Master sheet looks like:
I want the other sheet (eg sheet1) in this case to look like:
Is it possible to do this without entering a lookup formula in every cell?
If I'm understanding correctly, I don't think you actually need to use a macro for this.
Let's say that your MasterSheet is something like:
and your various sheets have the IDs in column A:
You could put this in B1:
=IF(ISNA(VLOOKUP($A1,MasterSheet!$A:$D,2,FALSE)),"",VLOOKUP($A1,MasterSheet!$A:$D,2,FALSE))
then simply increment the VLOOKUP's return column for each other column:
=IF(ISNA(VLOOKUP($A1,MasterSheet!$A:$D,**3**,FALSE)),"",VLOOKUP($A1,MasterSheet!$A:$D,**3**,FALSE))
Result:
You should probably use a better/quicker formula for the lookup to see if the ID exists (like Match)...
Hope this helps.
Cheers,
iso