| T O P I C R E V I E W |
| paul19 |
Posted - 08/05/2025 : 11:20:26 AM Hi all, I need to find the index of a certain cell, and am not sure how to do this. Basically what I want is the value of a cell in the neighbour column of a max value cell.
for example: A6309 is the max of col(A). I need the value of B6309. However, I don`t know where the max value of col(A) is. The problem with =index is that the data set is not strictly monotone, therefor the output of the command is a default error value of "-2".
Would really appreciate timely help, thanks a lot! Paul |
| 5 L A T E S T R E P L I E S (Newest First) |
| snowli |
Posted - 04/09/2026 : 10:40:54 AM Hi,
Unfortunately you have to specify 3rd parameter in 2025 with an existing column. It can't return index. One workaround is add a new column e.g. col(C) with row numbers. Then u can enter rowSTRindex = Lookup("STR",col(A), col(C));
Or use this rowindex=idx(match("STR", col(A)));
Thanks, Snow |
| farp1980 |
Posted - 04/07/2026 : 8:17:38 PM Hi,
I have a question regarding the lookup function and how it is different in Origin 2025 from Origin 2026.
I'm trying to find the row index of a cell in column A that contains the string "STR". The following command works okay in Origin 2026
rowSTRindex = Lookup("STR",col(A));
but it does not work in Origin 2025. I understand that in Origin 2025 a third parameter is needed to use the lookup function. However, my question is what would that parameter be if I want to get the row index?
Thanks!
|
| snowli |
Posted - 08/05/2025 : 5:24:44 PM You are welcome. We also have View: Formula bar. Click the Fx button there will pop up the Search window. You can type keywords to find functions. Also if you select a column, Ctrl+Q to open Set Column Values dialog. There is Function menu to see categorized functions, e.g. u will see index, lookup, table under "Lookup & Reference", which may help you find what you are looking for.
Using A, A1, etc. will be much easier for user who is familiar with Excel formula. https://www.originlab.com/doc/Origin-Help/Using-Formulae-to-Set-Cell-Values
Col(A), Col(A)[1] is Origin's own syntax. If you are assigning column or cell formula in Window: Script Window, you will have to use our own syntax.
Thanks, Snow
|
| paul19 |
Posted - 08/05/2025 : 1:19:28 PM Hi Snow, thanks a lot! That worked. I`m just getting started with Origin, so basically Ive got no clue what I am doing.
Why do I need to use the version w/o col() when in a cell. Bc using =max(col(A)) works just fine. Whats the difference between LabTalk Script window and normal in cell use?
obv not of importance, bc my problem is fixed now. But would be nice to know. Thanks once again. |
| snowli |
Posted - 08/05/2025 : 11:41:14 AM Hi Paul,
You can use lookup( ) function. E.g. if you use it in cell formula or F(x) cell of a new column, enter =lookup(max(A), A, B)
If you will use it in LabTalk Script window, use lookup(max(col(A)), col(A), col(B))
It search max(A) in column A and give corresponding value in column B.
Thanks, Snow |
|
|