Jump to content

Worksheet If/Then formula.


Recommended Posts

Testing on VW2019, your formula would look like the following:

=IF((D2='Width'),2,10)

If you're familiar with Excel, what's a little different is the extra set of parentheses around the logical test.  If you miss this, the result will simply by TRUE or FALSE depending on the logical test and it will reformat the formula to remove the IF statement.

Link to comment

I'm stuck trying to work out a nested if/then formula. Here's what I need to combine:

 

=IF((D2=WIDTH), MIN(HEIGHT, LENGTH), MIN(LENGTH, WIDTH))

and

=IF((D2=LENGTH), MIN(WIDTH, HEIGHT), MIN(LENGTH, WIDTH))

 

Or in human language! If D2 = WIDTH then show the minimum of HEIGHT and LENGTH, otherwise if D2 = LENGTH then show the minimum of HEIGHT and WIDTH.

 

Using OR might be a solution too.

Edited by Bruce Kieffer
Link to comment

What are Width and Length? Values in a cell?  If so, then they need to be compared as strings.

 

=IF((D2='WIDTH'), Min(HEIGHT, LENGTH), Min(Length,Width))

 

If they are numeric values, then your equals will fail unless they are equal out to 16 decimal places. You probably want to round to maybe two or three places to give the equals a better chance of working.

Link to comment

If you are combining multiple logical statements, then an ampersand ("&") is used for an AND condition and a vertical pipe character ("|") [on my Mac keyboard this is the shifted option for the forward slash character, right side of the keyboard, over the Return key] is use for an OR condition.

 

((A=B) & (C=D)).   A equals B AND C equals D

 

((A=B) | (C=D)).  A equals B OR C equals D

 

Link to comment

I'm experimenting since I can't seem to find any Vectorworks documentation explaining more complex formula functions. I cannot make "or" work in my formula. I get results, but they are not correct. I did find a way to write a nested if/then and it works.

 

=IF((D2=WIDTH), MIN(HEIGHT, LENGTH), IF((D2=HEIGHT), MIN(WIDTH, LENGTH), MIN(WIDTH, HEIGHT)))

 

This returns the middle value of the three values, which would be SO MUCH EASIER to do if only Vectorworks had a MEDIAN function.

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...