-1

I have a Calc document that has N sheets. First sheets are equal and contain some data. Last sheet is a summary.

My problem is that I need to use the LOOKUP function in the last sheet to look up for data in the N-1 previous sheets. This doesn't work:

=LOOKUP(X, Sheet1.A1:Sheet9.A100, Sheet1.B1:Sheet9.B100)

In this case it's valid a solution that requires to hardcode the sheets, i.e.:

=LOOKUP(X, FANTASTIC_JOIN_FUNCTION(Sheet1.A1:A100;Sheet2.A1:A100;Sheet3.A1:A100; ... ), FANTASTIC_JOIN_FUNCTION(Sheet1.B1:B100;Sheet2.B1:B100;Sheet3.B1:B100; ...))

but I don't know which is this FANTASTIC_JOIN_FUNCTION...

Any idea?

Ivan
  • 14,692
  • 17
  • 59
  • 96

1 Answers1

1

One way is to put this in cell A1 (or somewhere else that is convenient) on the summary sheet:

=LOOKUP(X, Sheet1.$A$1:$A$100, Sheet1.$B$1:$B$100)

In cell A2 put this:

=LOOKUP(X, Sheet2.$A$1:$A$100, Sheet2.$B$1:$B$100)

Continue this way for N-1 rows.

Now we need to get rid of #N/A errors. To do this, put this in cell B1:

=IF(ISNA(A1),"",A1)

Then fill this formula down N-1 rows.

Finally, merge the values into a single cell. For numerical data. this works:

=SUM(B1:B100)

For text data, concatenate all N-1 cells in the B column, for example:

=B1&B2&B3&B4&B5
Jim K
  • 12,824
  • 2
  • 22
  • 51