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
 VLOOKUP
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MISE

3 Posts

Posted - 05/11/2015 :  08:02:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,

I am using Origin 9.0 with Win 7 and looking for a solution to the following problem:

I have column A with product No. or ID.
Column B with price
Column C with product No. or ID.
I want to fill column D with prices of products listed in column C based on columns A and B.

With MS Excel I could solve this with "VLOOKUP". But I dont want to use MS Excel. Anyone know a comparable way to solve it with Origin?

Any help is appreciated

PS: Occasionally I have the chance to use Origin 9.1, if that makes any difference.

Hideo Fujii

USA
1582 Posts

Posted - 05/11/2015 :  2:19:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi MISE,

You can use the Lookup function in the Set Column Values tool as shown below:



You can read the details of this function at:
http://www.originlab.com/doc/LabTalk/ref/Lookup-func

Hope this works for your application.

--Hideo Fujii
OriginLab

P.S. Sorry, the Lookup function is a new feature of Origin 2015 version. In early versions, scripting may be needed.

Edited by - Hideo Fujii on 05/11/2015 4:13:57 PM
Go to Top of Page

MISE

3 Posts

Posted - 05/12/2015 :  03:41:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That only works with Origin 2015. I need exactly that function in Origin 9.0 or 9.1. Unfortunetaly I am new to Origin
I have no idea how to make this work with a script. Any hints?

Edited by - MISE on 05/12/2015 03:44:16 AM
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 05/12/2015 :  10:17:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi MISE,

The following code does the job for the above sample:
range rA=col(A);
range rB=col(B);
range rC=col(C);
range rD=col(D);
nr=rC.getSize(); //number of rows
for(ii=1; ii<=nr; ii++) {
  rD[ii]=rB[List(rC[ii],rA)]; //find and assign
}
You can learn LabTalk scripting from the following Guide/Tutorials:
http://www.originlab.com/doc/LabTalk/guide

Hope you enjoy to learn scripting.

--Hideo Fujii
OriginLab
Go to Top of Page

MISE

3 Posts

Posted - 05/13/2015 :  08:53:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Works perfectly! Thank you very much.

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