If...then statements in spreadsheets?

3,638 views
Skip to first unread message

Edward Deleon

unread,
Feb 18, 2009, 6:28:01 PM2/18/09
to tins...@googlegroups.com
Does the spreadsheet in the Nspire accept If...Then statements, similar to the way that Excel does? I've tried variations of the formula with little success.

I know it's possible to create a function in the Program Editor, but I was hoping for a simpler use within a spreadsheet cell. Besides, I need to include cell references within the If statement.

--
edward....@gmail.com
301-841-5221

Nelson Sousa

unread,
Feb 18, 2009, 7:23:13 PM2/18/09
to tins...@googlegroups.com

yes, you have a few.

a) you can use a when statement, as when(condition, value_if_true, value_if_false)
b) you can use iffn, which is an if function exclusive to the spreadsheet (it's used the same way as when)
c) you can also create functions, having all cell references passed as arguments to the function if you need a more elaborate structure
d) you can store the cells you need in variables and have a function use those variables to produce a given result.

Of course all these statements can be combined with logical operators like and, or, xor, etc, to produce very complex functions.

Also you can see count and countif functions, as they can be useful.

Nelson

Matteo Vicini

unread,
Mar 24, 2009, 2:50:20 PM3/24/09
to tinspire
Thanks Nelson,
this was very useful for me too!
I have to say that when works a lot better than iffn, the latter seems
to work one time only, in my case it gives always 'true' in the second
cell where I use it with the same condition, while in the first one it
seems to work, very strange. "when" made everything work as expected.

On 18 Feb, 19:23, Nelson Sousa <nso...@gmail.com> wrote:
> yes, you have a few.
> a) you can use a when statement, as when(condition, value_if_true,
> value_if_false)
> b) you can use iffn, which is an if function exclusive to the spreadsheet
> (it's used the same way as when)
> c) you can also create functions, having all cell references passed as
> arguments to the function if you need a more elaborate structure
> d) you can store the cells you need in variables and have a function use
> those variables to produce a given result.
>
> Of course all these statements can be combined with logical operators like
> and, or, xor, etc, to produce very complex functions.
>
> Also you can see count and countif functions, as they can be useful.
>
> Nelson
>
> On Wed, Feb 18, 2009 at 23:28, Edward Deleon <edward.m.del...@gmail.com>wrote:
>
> > Does the spreadsheet in the Nspire accept If...Then statements, similar to
> > the way that Excel does? I've tried variations of the formula with little
> > success.
>
> > I know it's possible to create a function in the Program Editor, but I was
> > hoping for a simpler use within a spreadsheet cell. Besides, I need to
> > include cell references within the If statement.
>
> > --
> > edward.m.del...@gmail.com
> > 301-841-5221

Jaiwant and Joanne

unread,
Mar 24, 2009, 5:59:03 PM3/24/09
to tins...@googlegroups.com
You say that iffn is exclusive to the spreadsheet.  I've used it in G&G and it works ok.

Jay
---

--- On Tue, 24/3/09, Matteo Vicini <Matte...@gmail.com> wrote:

Nelson Sousa

unread,
Mar 24, 2009, 6:34:21 PM3/24/09
to tins...@googlegroups.com
that's true, you're absolutely right.

For most practical purposes, the iffn function equals a combination of
a seq function and a when statement. So,
iffn(list>a,value1,value2)
is the same as
seq(when(list[i]>a,value1,value2),i,1,dim(list))
and it's a nicer way to test a list's elements.

Thanks for pointing that out.

Nelson
Reply all
Reply to author
Forward
0 new messages