| T O P I C R E V I E W |
| Camp19 |
Posted - 04/28/2026 : 3:42:39 PM 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 |
| 6 L A T E S T R E P L I E S (Newest First) |
| beepcrass |
Posted - 05/20/2026 : 10:09:18 PM 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, |
| ChaoC |
Posted - 04/29/2026 : 2:50:03 PM 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 |
| Camp19 |
Posted - 04/29/2026 : 2:40:13 PM 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 |
| ChaoC |
Posted - 04/29/2026 : 1:15:47 PM 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 |
| Camp19 |
Posted - 04/29/2026 : 12:28:49 PM 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 |
| ChaoC |
Posted - 04/29/2026 : 11:13:44 AM Hello Brandon,
Please try:
=table([Book1]Sheet1!$(2*i),[Book1]Sheet1!$(2*i-1),max([Book1]Sheet1!$(2*i)),0)
Best, Chao |
|
|