Create worksheetname of matrix in VLOOKUP-Function from Cell-Value - excel

I've got a working VLOOK-Function. The Matrix is on a different worksheet. Here is my function (in german):
=SVERWEIS($A1;Haus!$B$13:$K$100;7;falsch)
=VLOOKUP($A1,Haus!$B$13:$K$100,7,false)
I have lot of different worksheets and I do not want rewrite each formula by replacing Haus with the name of a different worksheet.
Is it possible to call the name from a cell? I want to have in Row 1 all worksheetnames and in row two the VLOOKUP-Function. In my imagination it should then be possible to drag the formula right and it autocompletes the formula with the right names.
A1 Haus
A2 =VLOOKUP($A1,Haus!$B$13:$K$100,7,false)
B1 Boot
B2 =VLOOKUP($A1,Haus!$B$13:$K$100,7,false)
C1 Pool etc.
I tried it with CELL("Content", A$1)&"!"$B$13:$K$100 inside the VLOOKUP-Function but it did not work as expected.
Any ideas?

Check out the INDIRECT function. Say you have your sheet name in A1 and the value that you want to look for is in A2. You could have formula in A3 like
=VLOOKUP(A2, INDIRECT(A1&"!$B$13:$K$100"), 7, FALSE)

Related

How to create and copy a formula which takes data from every second column and adds it to another sheet in a row

I have a sheet ("Names") with data starting in B1 and continuing across the row with a named value in every second cell. (eg B1, D1, F1 etc).
I would like to use a formula to insert this in a second sheet ("List") as a series of rows. (Eg. B6, B7, B8 etc)
I have tried to add an OFFSET formula to the "List" sheet but can't copy this down the page.
I have tried:
=OFFSET('Names'!B$1,0,2)
However when I copy this formula down the column it continues to reference the same cell.
How do I get this to increment so I end up with a formula in each row of the "List" such as:
=OFFSET('Names'!B$1,0,2)
=OFFSET('Names'!B$1,0,4)
Which would return a list of names from the first sheet?
For example:
B1
D1
F1
etc
I would like it so if more rows are needed in the "List" to correlate to new columns in "Names", the formula can be copied down the row.
Any help is greatly appreciated
Since, i have shared the solution in comments, hence sharing it in answers as well, so that some one looking for a solution may find it useful in future,
• Formula used in cell B6
=OFFSET(Names!$B$1,0,(ROW(A6)*2)-12)

How to link a cell to sheet reference

If I type Sheet2!A3 in A1 Cell of Sheet1, it will show the value of A3 cell of Sheet2. But I want to use this reference link from a cell in Sheet1
Please, look at the snapshot. I want to use the C1 cell to get the Sheet2 part of Sheet2!A3. So If I change the value of C1 from Sheet2 to Sheet3, then the formula in A1 will be changed to Sheet3!A3.
How to achieve this?
Try: =INDIRECT($C$1&"!A" & ROW() + 2)
This will mean you can have any sheet name in C1, and it should be able to get whatever cell you specify in the quotes (don't forget the exclamation mark!)
EDIT: Sorry, I missed that part, I've updated it now and it should work to increment.
You can add in another cell to make things simpler
In Sheet2 A3 i have the Value 10
And these formula Get that value with just some simple Indirect reference
If you want to make A3 Dynamic as well then :
The Aim is to get a cell which constructs the name of the cell/s you want to reference and then you can indirect Reference them accordingly.

How can I get each cell in a row in Excel to display its own address?

I am having a lot of trouble getting each cell in the first row of an Excel sheet labeled by its address.
i.e I want:
A1 B1 C1 D1 etc.
to be the first row of my sheet.
I have tried the function =ADDRESS(1,2,4,1) but it does not work generically. When I copy the ADDRESS function from cell B1 to C1, rather than outputting C1 in cell C1 it outputs B1. Can someone please help me figure this out? I feel like it should be very simple but isn't.
Use this formula:
=ADDRESS(ROW(),COLUMN(),4,1)
The Row and Column functions return the row/column of the cell, unless another cell reference is passed as an argument (e.g., Row(A100) would return 100). When the argument is omitted, then they return the row/column of the cell containing the function call(s).

How to drag down columns but change column letter?

I want to drag down a column but keep the same row of data by going into the next column on another sheet.
For example I have sheet1 with random data in row cells: A1 B1 C1 D1.
On sheet 2 I want to copy this row of data into a column for example: C3 C4 C5 C6.
I have tried used =OFFSET('sheet1'!$A$1,0,1) but this just keeps giving the data on cell B1.
How do I drag down the cells (autofill), but change the column letter and keep the same row number from another sheet?
Try,
=INDEX(Sheet1!$1:$1, 1, ROW(1:1))
Drag down as required. Here it is on a single worksheet.
    
Your formula would have worked as,
=OFFSET('sheet1'!$A$1, 0, ROW(1:1)-1)
But the OFFSET function is volatile¹ and best avoided if possible.
¹ Volatile functions recalculate whenever anything in the entire workbook changes, not just when something that affects their outcome changes. Examples of volatile functions are INDIRECT, OFFSET, TODAY, NOW, RAND and RANDBETWEEN. Some sub-functions of the CELL and INFO worksheet functions will make them volatile as well.
It sounds like you have to transpose() the data as Milind suggested because transpose should keep the formulas "intact" and simply reference the new positions of the cells rather than the old.
The easiest way to do this is to select the entire range of data, right click where you want the new data set to start (C3), then click
Paste Special
Transpose
You can use the Transpose() function in your target cells i.e. C3,C4,C5,C6.
This link shows the procedure in detail

How to reference value in cell to the left within a formula

I have 2 sheets in my spreadsheet. Sheet2 pulls information from Sheet1. In sheet2, there are 2 columns. Column A has company names. Column B has a formula which searches for the company name of that row within sheet1, and sums the values from that row in sheet1.
I have been able to achieve this with the following formula.
=SUMPRODUCT((Sheet1!B:B=A1)*(Sheet1!F:F))
This works fine, however I have to manually type "A1" into the formula. For the other rows, I would have to write B1, C1, D1 etc.
I have searched for how to reference the cell to the left, and I found this formula...
=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())), 0, -1)
This seems to work as a standalone formula in a cell, but I cannot figure out how to incorporate this into the SUMPRODUCT formula. Anything I try gives errors. I need something like this.
=SUMPRODUCT((Sheet1!B:B=(=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())), 0, -1)))*(Sheet1!F:F))
As per pnuts' suggestion to make it an answer:
The answer is just to drag the formula around. Just make sure to fix (either use F4 or add dollar signs) your range if it is not an entire column or an entire row

Resources