Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multiple If functions

Featured Replies

What is wrong with this function? It is telling me that an operator is expected at the last semi colon and beyond. Like it doesn't like the last part.

If ( Appointment Type = "C" ; If ( Total TIme > 1 ;"O" ) ; Appointment Type ) ; Appointment Type

You are missing the end bracket but tell us what you want in human words. Even if we solve your calculation, it wouldn't be very efficient.

UPDATE: For instance, it sounds like you want this:

If there is a number in total time and the Type is "C", enter a "O" otherwise leave it as it stands still with the Appointment Type. Is that what you want?

Hi Daniele! :smile2:

Edited by Guest

Do you meant to say : what is right ? :)

I think that it's better if you say us your question ( your calculation ) in plain english.

What is wrong with this function? It is telling me that an operator is expected at the last semi colon and beyond. Like it doesn't like the last part.

If ( Appointment Type = "C" ; If ( Total TIme > 1 ;"O" ) ; Appointment Type ) ; Appointment Type

Semi colons delimit function parameters. Parens enclose function parameters. You have a function, If(), and all the parameters (test; result; default result) need to be within parens.

In short, move your last parens to the very end.

If you moved your last parens to the very end, you'd be enclosing your function, but you'd have 4 parameters which is too many for If(). Delete the last "; Appointment Type".

Edited by Guest

  • Author

You are missing the end bracket but tell us what you want in human words. Even if we solve your calculation, it wouldn't be very efficient.

If I add the end parenthesis it says I do not have an equal number of parenthesis.

Here is what I want,

If the appointment type is "C" I want it to be changed to an "O" if the total time is more than 1 hour.

  • Author

If you moved your last parens to the very end, you'd be enclosing your function, but you'd have 4 parameters which is too many for If(). Delete the last "; Appointment Type".

If I delete the last ; Appointment Type then it would be an incomplete function. I'm trying to create a nested if function. So:

If (test1=1 ; if ( test2=2 ; result1b ; result2b) ; result 1b

I'm trying to create a nested if function.

Why not use the Case() function instead?

---

BTW, two nested If() functions would look loke this:

[color:blue]If ( test1 ; result1 ; [color:red]If ( test2 ; result2 ; defaultResult ) [color:blue])

Edited by Guest

I would use a Case Statement

Not sure if the results are what you are looking for, but this calculation

Case ( Appointment Type = "C" and Total Time > 1; 0 ; Appointment Type)

Produces a 0 if both conditions are met, and sets it to the Appointment Type if not.

Lee

  • Author

I would use a Case Statement

Not sure if the results are what you are looking for, but this calculation

Case ( Appointment Type = "C" and Total Time > 1; 0 ; Appointment Type)

Produces a 0 if both conditions are met, and sets it to the Appointment Type if not.

Lee

This works great! One last thing that I just noticed. I need appointment type to be either C OR S. I tried this but it doesn't seem to work.

Case ( Appointment Type = "C" or "S" and Total TIme > 1 ;"O" ; Appointment Type )

How about:

Case ( Appointment Type = "C" and Total Time > 1; 0; Appointment Type = "S" and Total Time > 1 ; 0 ; Appointment Type)

Lee

Edited by Guest
removed the second calc, did hold up

How about:

Case (

( Appointment Type = "C" or Appointment Type = "S" ) and Total TIme > 1 ; "O" ;

Appointment Type

)

  • Author

How about:

Case (

( Appointment Type = "C" or Appointment Type = "S" ) and Total TIme > 1 ; "O" ;

Appointment Type

)

Thanks Comment! Works great!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.