Skip to main content
Solved

Formula Not Functioning as Expected

  • October 23, 2019
  • 0 replies
  • 83 views

Forum|alt.badge.img+2
Hi,

Can someone please help me with the following formula. I have comments under each line as to what it should be doing, but it is not doing that. It is just displaying zero.

If([Spent By]=ToUser("John Doe") and [Shared Purchase?]=true, [Amount]/2,
//If user is John Doe and Checkbox is checked, display the amount divided by two, otherwise execute next if statement.

If([Spent By]!=ToUser("John Doe") and [Shared Purchase?]=true, [Amount]/2,
//If user is not John Doe and Checkbox is checked, display the amount divided by two, otherwise execute next if statement.

If([Spent By]=ToUser("John Doe") and [Shared Purchase?]=false, [Amount], 0)))
//If user is John Doe and Checkbox is NOT checked, display the amount, otherwise display 0.

I also tried adding a couple extra sets of parentheses to break it up more, but that didn't work either.

------------------------------
Curtis Middleton
------------------------------

Best answer by EverettPatterso

Try this one

If(UserToName([Spent By], "FF")="John Doe" and [Shared Purchase?]=true, [Amount]/2,
//If user is John Doe and Checkbox is checked, display the amount divided by two, otherwise execute next if statement.

UserToName([Spent By], "FF")!="John Doe" and [Shared Purchase?]=true, [Amount]/2,
//If user is not John Doe and Checkbox is checked, display the amount divided by two, otherwise execute next if statement.

UserToName([Spent By], "FF")!="John Doe" and [Shared Purchase?]=false, [Amount], 0)
//If user is John Doe and Checkbox is NOT checked, display the amount, otherwise display 0.​


------------------------------
Everett Patterson
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
If you actually are using a person's name here

Spent By]=ToUser("John Doe")

Then there is no way for that to work, as you would need to put in email address to uniquely identify the user.  Lots of people have the same name.

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
markshnier2@gmail.com
------------------------------

EverettPatterso
Forum|alt.badge.img+10
Try this one

If(UserToName([Spent By], "FF")="John Doe" and [Shared Purchase?]=true, [Amount]/2,
//If user is John Doe and Checkbox is checked, display the amount divided by two, otherwise execute next if statement.

UserToName([Spent By], "FF")!="John Doe" and [Shared Purchase?]=true, [Amount]/2,
//If user is not John Doe and Checkbox is checked, display the amount divided by two, otherwise execute next if statement.

UserToName([Spent By], "FF")!="John Doe" and [Shared Purchase?]=false, [Amount], 0)
//If user is John Doe and Checkbox is NOT checked, display the amount, otherwise display 0.​


------------------------------
Everett Patterson
------------------------------