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
 Dynamic Column References Across Workbooks
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Camp19

3 Posts

Posted - 04/28/2026 :  3:42:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2022b (64-bit) SR1 9.9.5.171 (Academic)

Operating System: Windows 11 Home

Hello,

I have two workbooks. The first contains 19 pairs of columns. In the second I want to output the data in the first column of each pair at the index of the maximum value of the second column. I want each row of the second workbook to correspond to a different pair of columns.

I have created the following formula to try to achieve this. =table([Book1]Sheet1!(2i),[Book1]Sheet1!(2i-1),max([Book1]Sheet1!(2i)),0)

However, it seems I cannot put an expression inside the column reference to reference the i-th column where i is the current row index. How can I dynamically reference columns like this, or what is a better way to do this?

Thank you,
Brandon

ChaoC

USA
231 Posts

Posted - 04/29/2026 :  11:13:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Brandon,

Please try:
=table([Book1]Sheet1!$(2*i),[Book1]Sheet1!$(2*i-1),max([Book1]Sheet1!$(2*i)),0)


Best,
Chao
Go to Top of Page

Camp19

3 Posts

Posted - 04/29/2026 :  12:28:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Chao,

Thank you for the reply, I didn't catch the implicit multiplication! I have used the formula you provided. The column populated with the same number in every cell. It is the correct number for the first cell corresponding to the first two columns of data. Is something else wrong with the indexing or the table function?

Thanks,
Brandon
Go to Top of Page

ChaoC

USA
231 Posts

Posted - 04/29/2026 :  1:15:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Brandon,

Can you check the other cells to make sure the formula is the same?
You can quickly check the cell formula by turning on Edit>Edit Mode (Ctrl+Alt+B).
Origin 2022b may have had some issues with the drag fill for this kind of formula.

See example project file: https://my.originlab.com/ftp/forum_and_kbase/Images/48831.opju

Best,
Chao
Go to Top of Page

Camp19

3 Posts

Posted - 04/29/2026 :  2:40:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Chao,

I was putting the formula in the set values "F(x)=" cell, that seemed to be the issue. Once I placed the formula in each cell like in your project file, it worked. And, you are right, the drag fill completely butchers the formula.

Thanks for the help!

Thank you,
Brandon
Go to Top of Page

ChaoC

USA
231 Posts

Posted - 04/29/2026 :  2:50:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Brandon,

Glad to hear it worked!

Since the drag fill doesn't work well for this in 2022b (works in newer versions), if you want to quickly add the formula to the cells instead of copy paste individually, you can highlight your column and go to Colmun>Fill Column With>Arbitrary set of Text&Numeric Values and enter the formula in the "Text to Repeat" box.

Best,
Chao
Go to Top of Page

beepcrass

USA
1 Posts

Posted - 05/20/2026 :  10:09:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by ChaoC

Hello Brandon,

Can you check the other cells to make sure the formula is the same?
You can quickly check the cell formula by turning on Edit>Edit Mode (Ctrl+Alt+B).
Origin 2022b may have had some issues with the drag fill for this kind of formula.

See example project file: https://my.originlab.com/ftp/forum_and_kbase/Images/48831.opju https://phrazle.co

Best,
Chao


Hey Chao,

Thanks for the heads-up and the link to the project file. I just opened it up and used Ctrl+Alt+B to double-check the rest of the cells like you suggested. It looks like your hunch about the Origin 2022b drag-fill bug was spot on—a few of the formulas down the column definitely got messed up and didn't increment correctly. I've gone ahead and fixed them manually so they match up now. Good catch on that, I appreciate you looking out!

Best,

Edited by - beepcrass on 05/20/2026 10:09:52 PM
Go to Top of Page
   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