The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Table-Function - include References (Solved)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Cracker

6 Posts

Posted - 06/07/2022 :  08:02:16 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear forum members,
I have two questions/problems.

For a project I would like to use the table function (link below). Until now i used the index function (pic below green background), but unfortunately not all my data is strictly monotonic. So I switched to the table function.
As you can see (purple background), I am able to generate the same data. My first problem is, I cannot add cellreferences into the function.

The picture shows the function "=table(1!C;1!C;C1;2)-C1". But instead of "1!C" I would like to insert "A2" -> "=table(A2;A2;C1;2)-C1". This does not work, the result is -50.

Secondly, I cannot "fix/lock" certain references using $. As soon as I add the $ symbol, like "=table(1!$C;1!C;C1;2)-C1" the table function returns the value 0.

With the index function I had none of these issues. Maybe I am missing something, Origin is a relative new experience for me.

The ideal solution would be to add the cellreferences and lock these.






Link: https://www.originlab.com/doc/en/LabTalk/ref/Table-func

Thanks in advance,
Cracker

I am using:
Windows 10 Home
Origin 2021, Vers. 9.80.200

Edited by - Cracker on 06/07/2022 09:31:33 AM

YimingChen

1592 Posts

Posted - 06/07/2022 :  09:09:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you try the following script:
=table(%($A2$); %($A2$); C$1; 2)  - C$1


In %($A2$), the first dollar sign is to fix col(A) when extending to the right cells. The second dollar sign plus the percentage sign is substitution notation which substitute A2 by its content 1!C before execution.
https://www.originlab.com/doc/en/LabTalk/guide/Substitution-Notation#.25.28_.29_Substitution

In C$1, the dollar sign is to fix row 1 when extending the cells downwards.


James

Edited by - YimingChen on 06/07/2022 09:09:46 AM
Go to Top of Page

Cracker

6 Posts

Posted - 06/07/2022 :  09:35:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello James,

thank you for your help. Your expression works perfectly. Also, thanks for explaining your solution, this "Substitution" is something new to me.

Cheers
Cracker
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000