Wie man die Daten von einer Zelle erhält, um die Funktion anderer Zellen zu verändern

364
user197060

Ich habe über 10 Arbeitsblätter mit den gleichen Layouts, die alle Daten aus verschiedenen Tagesjobs enthalten. Ich versuche, ein "SimpleSheet" zu erstellen, das nur bestimmte Daten aus einem Tagesblatt in einem schönen Layout abruft. Bisher mache ich es manuell:

A1 | ='DaySheet1'.A1 A2 | ='DaySheet1'.A2 

Was ich tun möchte, ist, die Funktionen zu ändern, anstatt zu sagen, wo DaySheet sagt: "Ziehen Sie das Blatt, das ich in der SimpleSheet-Zelle B1 definiert habe."

B1 | *whatever sheet* A1 | ='B1'.A1 A2 | ='B1'.A2 
0

1 Antwort auf die Frage

2
mcalex

Use Indirect.

Indirect allows you to use a string as a reference to a worksheet location. So, if the content of cell A1 is set to 'DaySheet', you can use the formula =Indirect(A1)!B1 and the result will be whatever is in cell B1 in the DaySheet sheet.

From the support page:

You can reference each attribute of the reference (workbook name, worksheet name, and cell reference) individually by using the INDIRECT function to create a user-defined dynamic reference with worksheet cell references as inputs.

EDIT: Might need a mention on how to deal with referencing the current cell.

To drill down from the sheet to the cell, you can either use a string reference (eg "A1") concatenated to the indirect reference, or you can use the address function to do it dynamically. Below is an example of both:

String:

=INDIRECT(CONCATENATE($A$1,"!","B1"))

Dynamic:

=INDIRECT(CONCATENATE($A$1,"!",ADDRESS(ROW(), COLUMN(), 4)))

The first is easiest where you don't copy from too many cells. More than a handful, and I'd go with the second option.

MS help on the Address function.

Nur eine kleine Anmerkung: Verweise auf andere Arbeitsmappen, die auf "INDIRECT" basieren, funktionieren nur dann **, wenn die Arbeitsmappe geöffnet wird. Weitere Informationen finden Sie unter http://stackoverflow.com/a/14788167/2043977 Peter L. vor 11 Jahren 0
A1 ist auf 'DaySheet' eingestellt. B1 = indirekt (A1) Parse Error. B1 = indirekt ("a1") gibt 'DaySheet' zurück. B1 = indirekt ("A1")! B1 Parse Error. = indirekt ("'DaySheet'! B1") Gibt die korrekte Zelle zurück. = indirekt ("'DaySheet'")! B1 Parse Error. user197060 vor 11 Jahren 0
@ user197060 bearbeitet mcalex vor 11 Jahren 0