Excel: Select every 5th column on another sheet, drag and autofill - excel

I'm looking to select every 5th column from another sheet, and put it into one row where they're next to each other, and be able to drag it so it autofills as there is a lot more columns.
It should come out like:
=Sheet1!B$4 | =Sheet1!G$4 | =Sheet1!L$4 | =Sheet1!Q$4 ...
=Sheet1!C$4 | =Sheet1!H$4 | =Sheet1!M$4 | =Sheet1!R$4 ...
...
How can I do this with a formula?

In your first cell of choice:
=INDEX(Sheet1!$4:$4,5*(COLUMNS($A:A)-1)+ROWS($1:2))
Copy across and down as required.
Note that INDEX set-ups should be preferred to volatile OFFSET/INDIRECT ones.
Regards

Related

Extracting all information(different) with same row name form a excel worksheet using formula

I have a excel workheet having a table with multiple rows having same name with different information in the corresponding columns. Now using a formula I want to extract this infomation into a new table? SOLUTION HAS TO BE USING AN EXCEL FOMULA ? NO FILTERS NO PIVOT TABLE OR VBA
I have tried vlookup. to search for multiple values. I dont want information from a single column but rather from all the columns. There could be thousands of columns with same and different values.
I have tried this formula : =INDEX(Worksheet!A2:AK350;KKLEINSTE(WENN((A5=Worksheet!A2:A350);VERGLEICH(ZEILE(Worksheet!A2:A350);ZEILE(Worksheet!A2:A350));"");1))
The table looks like this for example:
Place People Salary Status
japan | resident_1 | 564 | un-married
Delhi | resident_1 | 655 | un-married
china | resident_1 | 564 | un-married
japan | resident_2 | 748 | un-married
Now I want to extract a sub table from the above, like all the
infomation having PLACE name as "japan"
the reult should be this for each place in a different table:
japan | resident_1 | 564 | un-married
japan | resident_2 | 748 | un-married
Seems like a job for advanced filter, but you've already stipulated "no filters". If you're able to add two helper columns in your main table, maybe you can use the approach below.
This is my main_table worksheet (note the columns outlined in red, which have been added).
The formula in column E (starting from cell E2) is: =CONCAT(A2,"|",B2,"|",C2,"|",D2)
The formula in column F (starting from cell F2) is: =ROW()-ROW($F$2)+1
Drag/fill these formulas down to the last row in your main table.
This is my sub_table worksheet (note the cells outlined in green at the top, where you will eventually specify filter criteria).
The formula in column A (starting from cell A5) is: =ROW()-ROW($A$5)+1
The formula in column B (starting from cell B5) is: =IFERROR(SMALL(IF(ISNUMBER(SEARCH($B$2,main_table!$E$2:$E$10)),main_table!$F$2:$F$10,""),$A5),"")
The formula in columns C, D, E, F (starting from cell C5) is: =IF(ISNUMBER($B5),INDEX(main_table!$A$2:$D$10,$B5,COLUMNS($C5:C5)),"")
The formula in cell B2 is: =CONCAT(IF(ISBLANK($C$2),"*",$C$2),"|",IF(ISBLANK($D$2),"*",$D$2),"|",IF(ISBLANK($E$2),"*",$E$2),"|",IF(ISBLANK($F$2),"*",$F$2))
You should drag the formula down for the same number of rows that are in your main table.
I think newer/upcoming versions of Excel have a JOIN worksheet function which is more convenient/flexible than my usage of CONCAT above (so maybe use that if it's available to you).
Leaving the filter criteria blank should give you all rows. If you want partial matches, include wildcards in your input e.g. jap* or resident_*. If any of the values in your main table contain a |, you may want to use a different delimiter in the CONCAT formulas (otherwise you may get unexpected results/behaviour).
Once you're done, maybe you can use it like shown below:
See if this approach is any good for you (you will probably need to translate the formulas to your locale/region).

Display in Sheet1 newest entries from Sheet2 to Sheetn in excel

I have an excel file which has an arbitrary number of sheets. From Sheet2 to Sheetn the structure is the same:
| A | B | C | D |
------------------------------
| Date | Name | Value | Type |
| Date | Name | Value | Type |
However, these rows are not sorted by the date, so the 1st row of each sheet is not guaranteed to be the newest date.
The first sheet has one row for each sheet and it should be updated to include the most recent entry in each sheet.
For example, if we have 4 Sheets, then Sheet 1 will have 4-1=3 rows which will be: the row with the newest date of Sheet 2, the row with the newest date of Sheet 3, and the row with the newest date on Sheet 4.
A file equals a thousand words, so you can download the excel file here and see what I need.
I've actually figured out a solution. I'm guessing it's significantly far from the best one, but since I'm by no means an excel person, the fact that it works is enough for me.
For other non-excel people who just need to achieve this without learning excel, here's how I did it:
=INDEX(MySheetName!$A$2:$G$10000,(MATCH(MAX(MySheetName!$C:$C),MySheetName!$C:$C,0)-1),COLUMNS(MySheetName!$A$1:A1))
Replace "MySheetName" on its 4 occurrences to the actual Sheet name of each of your excel's sheets.
Replace Columns 'A to G' on the INDEX to the columns you want to retrieve.
Replace Column C:C on the MATCH to the column you want used to retrieve the row number using its MAX()
Remember to span the formula to multiple columns, as many as the maximum columns that the sheet you reference has.
What I'd like to improve now is to make it able to span multiple rows as well, which for me it would mean that it would automatically reference all the columns of the next excel sheet. For now, one needs to manually replace "MySheetName".
The "10000" also looks really bad, but I don't know how to many sure that it will get the Max() over all rows. I'll never fill more than 100 rows on each sheet, so 10000 seems safe.

How to use arrayformula to indicate an occurrence in google sheets

I'm trying to write an =arrayformula that finds the 1st, 2nd, 3rd, etc. occurrence of a value in another column. I can do this with a formula copied down all rows but I don't want to use this method, I need the arrayformula to simply always update the column because I need to constantly insert and delete rows and I don't want to have to keep copying the formula down. Thanks in advance.
Google sheet where I'm testing this.
Example formulas that I currently have to copy down..I want this to simply be an arrayformula instead:
values | occurance
aa | =if(A3<>"",countif($A$3:$A3,A3),"") | RESULT:1
2 | =if(A4<>"",countif($A$3:$A4,A4),"") | RESULT:1
aa | =if(A5<>"",countif($A$3:$A5,A5),"") | RESULT:2
5 | =if(A6<>"",countif($A$3:$A6,A6),"") | RESULT:1
5 | =if(A7<>"",countif($A$3:$A7,A7),"") | RESULT:2
4 | =if(A8<>"",countif($A$3:$A8,A8),"") | RESULT:1
Formulas that work but have to be copied down
Check out cell D3 where I used this formula:
=ArrayFormula(iferror(SORT(ROW(A3:A),SORT(ROW(A3:A),A3:A,1),1)-MATCH(A3:A,SORT(A3:A),0)-ROW()+2))
and see if that works for you ?

Excel VLookup #NV error

I'm trying to make a VLookup in Excel but I get everytime a #NV error.
This is table EVENTS:
This is table TRACK:
the formula on field F2 in table EVENTS is
=SVERWEIS(E2;TRACKS!$A$2:$B$52;1;FALSCH)
SVERWEIS is the word for VLOOKUP in the German version. FALSCH means wrong
As has been mentioned, VLOOKUP (SVERWEIS) can only look to its right to find a value to correspond with a value in the left hand columns of a table. The INDEX/MATCH combination is more flexible in this respect so if not to rearrange your columns I would suggest something like:
=INDEX(A:A,MATCH(E2,B:B,0))
where TRACK is assumed to be in ColumnsA:B. Converting to German, perhaps:
=INDEX(TRACKS!A:A;VERGLEICH(E2;TRACKS!B:B;0))
VLOOKUP compares the values in the first column of your reference target, you have your target values in the second.
Just swap VLOOKUP and the TEXT columns on your TRACKS sheet and it will work just fine.
Try switching the columns in TRACKS around.
VLOOKUP bases it's lookup on the first column, so in your case, it's looking through column A (1, 2, 3, etc.)
If you want your VLOOKUP to be based on the text, it needs to be in A instead.
i.e.
| A | B |
----------------------
1 | TEXT | VLOOKUP |
2 | Text1 | 1 |
3 | Text2 | 2 |
etc...
Then your function will be:
=SVERWEIS(E2;TRACKS!$A$2:$B$52;2;FALSCH)
Switching out the third argument because you now want the value from the second column

Excel multi column lookup

I am unsure how to Google this one. I have a table that looks like the below
Last Name | First Name | Team A | Team B | Team C
Smith | John | X | |
Doe | Jane | | X |
This would be the main sheet. The names in this sheet are divided into other sheet depending on what department they are in. Those sheets are setup in the same formats with the same columns. If the people in the main sheet are marked with an X in one of the columns I would like that same column marked in marked in the department sheets.
Your best bet might be to create a hidden column A where the value is a combination of column B and column C on all of your tabs. You could then use the standard VLOOKUP wrapped in an IFERROR clause.
For example,
=IFERROR(VLOOKUP(A1,Sheet1!A:F,3,False),"")
The IFERROR handles the instance that you may have a name on a sub tab not on the main tab. It returns blank instead of #N/A. The VLOOKUP is checking the value in A1 to what is in A1 on your main tab. A1 would be the combination of First and Last. The VLOOKUP would need to be in each of your team columns shifting the column returned number in each VLOOKUP.

Resources