[Solved] INDIRECT function

Discuss the spreadsheet application
Post Reply
tactps
Posts: 3
Joined: Wed Dec 13, 2023 2:21 am

[Solved] INDIRECT function

Post by tactps »

Hi.

I usually work in Excel (boo hiss) and am having a problem writing an indirect fuction in Calc.

I have sheets named with each date, eg
08.12.2023
09.12.2023
10.12.2023

I have a normal function that picks up a cell in the prior sheet. For example, on my sheet 09.12.2023 in cell I2 I have the function
=+'08.12.2023'.d27

I would like to write an indirect function so that the name of the worksheet (08.12.2023 in this example) is picked up from another cell.

In other words, I have the text "08.12.2023" in cell c12. I would like to use that to determine which sheet my value is in.

In Excel I would write
=INDIRECT(C12&"!D27")

But I just can't seem to get the syntax right in OpenOffice.

Thank you for reading this, and hopefully helping me.
Last edited by robleyd on Wed Dec 13, 2023 9:01 am, edited 2 times in total.
Reason: Add green tick
OpenOffice 4.1.13 on Windows 10 Pro 64-bit run by an idiot
FJCC
Moderator
Posts: 9291
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: INDIRECT function

Post by FJCC »

This seems to work.

Code: Select all

=INDIRECT("'"&C12&"'" & ".D27")
The sets of quotes on either side of C12 are single quotes wrapped in double quotes. If you used underscores instead of periods in your sheet names, you would not need the single quotes.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
tactps
Posts: 3
Joined: Wed Dec 13, 2023 2:21 am

Re: INDIRECT function

Post by tactps »

Thank you. That's perfect.
OpenOffice 4.1.13 on Windows 10 Pro 64-bit run by an idiot
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] INDIRECT function

Post by Lupp »

Never use sheet names that require such twisting. Use clean sheet names not containing spaces or any special characters.
The sheet-per-day design is doubtable anyway, but in cases where it may be justified the date should be given in the slightest acceptable variant of ISO 8601. In Your example I would suggest D_2023_12_08. You won't need the silly apostrophes then.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
tactps
Posts: 3
Joined: Wed Dec 13, 2023 2:21 am

Re: [Solved] INDIRECT function

Post by tactps »

Thank you Lupp. Very sound advice.
OpenOffice 4.1.13 on Windows 10 Pro 64-bit run by an idiot
Post Reply