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 for Programming
 LabTalk Forum
 Column Formula to get row and col index of cell
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1228 Posts

Posted - 07/18/2022 :  08:04:46 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2023 (64-bit) Beta 1 10.0.0.47
Windows 7 Pro SP1 x64

Greetings!

What formula function can I use to to get row and col index of a specified cell?

Thank you.

---
Andrey

YimingChen

1684 Posts

Posted - 07/18/2022 :  09:59:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can use wks.c1, wks.c2, wks.r1, wks.r2 to get the selection range.

James

Edited by - YimingChen on 07/18/2022 09:59:57 AM
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/18/2022 :  11:03:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

You can use wks.c1, wks.c2, wks.r1, wks.r2 to get the selection range.

James



Dear James,

What should use to get row numbers of the cells in another column?

---
Andrey
Go to Top of Page

YimingChen

1684 Posts

Posted - 07/18/2022 :  11:09:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Do you mean you have multiple selections in a worksheet? Maybe you can use this X-function get_wks_sel.

https://www.originlab.com/doc/X-Function/ref/get_wks_sel

James
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/18/2022 :  1:03:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Do you mean you have multiple selections in a worksheet? Maybe you can use this X-function get_wks_sel.

https://www.originlab.com/doc/X-Function/ref/get_wks_sel

James



Dear James,

No, I don't.
What formula can I use to get row indices in column И,


---
Andrey
Go to Top of Page

YimingChen

1684 Posts

Posted - 07/18/2022 :  5:11:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
i, j for the current row and col index. Is this what you looking for?



James
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/19/2022 :  01:07:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Do you mean you have multiple selections in a worksheet? Maybe you can use this X-function get_wks_sel.

https://www.originlab.com/doc/X-Function/ref/get_wks_sel

James



I tried to set the column formula to i, but sometimes it expands the numbers to the very bottom of the sheet instead of ending at the last line of the adjacent column.

The following formula worked in my case and delivers the row numbers and is limited by the specified column:
sum(1-IsEmpty(A))


Is there an simplier formula for this?

---
Andrey
Go to Top of Page

YimingChen

1684 Posts

Posted - 07/19/2022 :  09:03:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What about this expression? isna(A) ? na() : i

James
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