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
 Variable in every single column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ONeilll

33 Posts

Posted - 03/09/2023 :  04:48:53 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Pro 2023 10.0.0.154
Operating System: Windows 10

Hello Origin Community!
To calculate a value of a column I use a formular that includes a "user defined variable" that is located in %(Col(XXX)[D1]$. So far I change XXX for every single column, e.g., in column A it is %(Col(A)[D1]$. I do not want to change it by hand for every single colum. How can I make the column name as a variable? Many thanks for your help in advance.

YimingChen

1651 Posts

Posted - 03/09/2023 :  08:59:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you try %(This[D1]$) if the calculation is for the current column?

James
Go to Top of Page

ONeilll

33 Posts

Posted - 03/09/2023 :  10:13:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear James,
thanks for your answer, but that does not work for me. It is indeed in the current colume, but when I use your suggestion origin does not seem to find the value.

Edited by - ONeilll on 03/09/2023 10:17:52 AM
Go to Top of Page

YimingChen

1651 Posts

Posted - 03/09/2023 :  10:18:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please provide more details or maybe attach a screenshot of your worksheet. Thanks.
Go to Top of Page

ONeilll

33 Posts

Posted - 03/09/2023 :  10:59:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dea James,thanks again. You can find a minimal example attached.



Edited by - ONeilll on 03/09/2023 11:01:29 AM
Go to Top of Page

snowli

USA
1417 Posts

Posted - 03/09/2023 :  12:39:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This seems work
-cos(This[D1]/180*PI)*(5)/(ln(wcol(1)))


Also instead of using column name, u can use wcol(j) to refer to current column.

E.g. -cos(%(wcol(j)[D1]$)/180*PI)*(5)/(ln(wcol(1)))


U can double click the black dot at bottom right corner of F(x) cell to auto fill F(x) cells of all columns to its right.

Thanks, Snow
Go to Top of Page

ONeilll

33 Posts

Posted - 03/10/2023 :  03:40:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Snowli, that is working for me. Appreciate your comments, thanks to the both of you!
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