Discussions

View Only

Can I use an "if" formula with numeric fields?

• 1.  Can I use an "if" formula with numeric fields?

Posted 12 days ago
Hello, I am trying to use an "if" statement for a formula in a Formula - Numeric field.  I am getting the error: "Expecting bool but found number."

I understand what that means, but I don't understand how to write the formula to fix it.

Here is the formula:

IF (([Numeric field #1] - [Numeric field #2] + [Numeric field #3]) > ([Numeric field #1] * 0.25), ([Numeric field #1] * 0.25), ([Numeric field #1] - [Numeric field #2] + [Numeric field #3]))​

------------------------------
Josh Collins
------------------------------

• 2.  RE: Can I use an "if" formula with numeric fields?

Posted 12 days ago
If you want a numeric result then you will need to change the field type to be formula numeric.

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------

• 3.  RE: Can I use an "if" formula with numeric fields?

Posted 12 days ago
Without changing anything in your formula it worked for me. When I copied it over it did have a weird red highlighted character at the end but I just deleted that, you may or may not have that in yours.

Are you positive these are Numeric fields(not Numeric - Currency, Numeric - Percent, etc) and that you are working with a Numeric Formula field? It sounds kind of like it may be a Formula Checkbox.

• 4.  RE: Can I use an "if" formula with numeric fields?

Posted 12 days ago
Hey Austin, thanks for the reply.

You're correct, I didn't accurately give you the field type.

Numeric Field #1 is actually "Formula - Currency"
Numeric Field #2 is actually "Formula - Currency"
Numeric Field #3 is actually "Currency"

Would it be as easy as changing these to the type "Formula - Numeric" and "Numeric" and then just displaying the result as currency instead of simple number?

Thanks!​

------------------------------
Josh Collins
------------------------------

• 5.  RE: Can I use an "if" formula with numeric fields?

Posted 12 days ago
Josh, what is the field type of your formula field?

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------

• 6.  RE: Can I use an "if" formula with numeric fields?

Posted 12 days ago
Hey Mark, it is a "Formula - Currency" field.

------------------------------
Josh Collins
------------------------------

• 7.  RE: Can I use an "if" formula with numeric fields?

Posted 12 days ago
Josh,
Can you paste in the full text of the error when you go to save the formula?   If we are not able to diagnose the problem that way then I'm happy to have a quick look at your formula tomorrow on a zoom call.

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider