Jump to content

If(then) function in Worksheet


Recommended Posts

Hi,

I'm trying to use an "If(logical_test,value_if_true,value_if_false)" function in a worksheet.

I refer to the syntax of the manual, so I've got for example :

value 7 in cell A1

value "if((A1=7),A1,0")in cell B1

I expect to get 7 as a result in B1 yet I only get my formula recopied...

I don't get it... Any clue?

Link to comment

Hi Raymond,

sorry, I mistyped, I did put an equal sign.

When I enter "=if((A1=7), A1, 0" in B1, it writes "=if((A1=7), A1, 0" in the cell. It does not treat it as a function...

Also, if I make a data base listing e.g. all the rectangles of the drawing, if I enter =Area, it returns the area of each listed rectangle, but if I ask for =Area(B1>100), it does not return (as I expected) the area of the corresponding rectangle if B1 is superior to 100, but it does return "true" or "false" according to whether or not my condition is fullfiled...

Link to comment

This is odd. On my system it works as expected with or without spaces in the formula, and with or without the brackets around A1=7.

In fact the only way I can get the formula to display as text is to put a space in front of =. I don't see a space in front of LMT's example...Have you tried a restart and a fresh new doc?

In your database header this: =IF(AREA>100, AREA, 0) should do what you want.

Link to comment

This is indeed very bizarre, I've sent the file to techsupport, I'll tell you what they say.

I've tested with or without spaces : the result is the same. I have no space before the = sign...

See (no spaces on the left, spaces on the right:

-

As for the AREA formula, CCROFT's proposal alas does not work. The result is in B3.

I've got a true/false value in C3 by entering the formula =AREA(AREA>0)

-

I'll send that want to techsupport as well...

Will let you know

Link to comment
  • 13 years later...

I think Julian means nested, or something like this:  

 

=IF((A1=1), 'Red', IF((A1=2), 'Blue', IF((A1=3), 'Green', IF((A1=4), 'Yellow', IF((A1=5), 'Orange', IF((A1=6), 'Purple', '?'))))))

 

Though, I thought the limit was 7.

Edited by M5d
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...