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

finner1984

Germany
4 Posts

Posted - 06/26/2010 :  08:06:00 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hey guys,

i wanna subtract 2 worksheets (both in the same workbook) from each other. Unfortunately, i didnt find a solution yet.

Example: i have a workbook (book1) with 3 Sheets (Sheet1 to Sheet3). Now i want that:

book1_Sheet3_colB = book1_Sheet1_colB - book1_Sheet2_colB. And so on for the other columns.

I think the Syntax Workbook_column does only work for books. I tried book1_sheet1_A, but Origin doenst understand that.

Im using Origin 8.

Thanks.


AmandaLu

439 Posts

Posted - 06/27/2010 :  11:22:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear finner1984,

Workbook_column is the old syntax and cannot refer to sheet level. To subtract 2 worksheet columns, you can use Range variable:

range r1 = [book2]Sheet1!B;
range r2 = [book2]Sheet2!B;
range r3 = [book2]sheet3!B;
r3=r1-r2;

Edited by - AmandaLu on 06/27/2010 11:33:39 PM
Go to Top of Page

DataConv

Germany
60 Posts

Posted - 06/28/2010 :  04:08:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Additionally, i would suggest to use the index mode rather than the name mode.
E.g.: Instead of [book2]Sheet1!B it looks like [book2]1!Col(2). At first, this seems to be more complicated. There are worksheet manipulations or if you are using the same name multiple times, where the name mode fails, the index mode however still works...

An additional note to the example of AmandaLu: there is an easy way to insert the ranges. Just use in the tab 'variables' the 'insert range variable' tool in the 'calculate rows' tool.
Go to Top of Page

finner1984

Germany
4 Posts

Posted - 06/29/2010 :  09:57:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
yeap, that works!
Thank you AmandaLu and DataConv!
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