Two-Condition IF Formula


What is the syntax for an IF statement that only generates output if two conditions, in two fields, are met?

Thanks for your help!

Two 'finds' in filterbyformula API URL
#2 describes in detail how to nest if statements. You could also use an if and an and.


To output one value if two conditions are true, and another value otherwise:
IF(AND(Condition-1, Condition-2), Value-If-Both-Are-True, Value-If-Either-Are-False)



Right now I have a field that creates an underscore if the referenced field contains data. It’s generating a separator for auto-filenaming.

IF(SEGMENT1 = 0, “”,"_")

But it only works when the field that contains data for the second segment of the filename, the one after the underscore, is present.

When the second segment field is empty, I need the first field to return nothing.

Something like (and pardon my french): IF((SEGMENT1 = 0, “”,"_") BUT(IF(SEGMENT2 = Y, “”,"")))


In that case you may need to use OR() to combine two conditions if either are true (used just like AND otherwise), or NOT() to reverse a single condition. Try different combinations of those. For example,

IF(OR(Condition-1, NOT(Condition-2)), Value-1, Value-2)


Is it possible to create a conditional IF formula to perform a calculation IF a certain condition is met? I have a CHARGES column, a PAYMENTS column and a DISCOUNT column. I want to creat a formula to calculate the discount IF there is a value entered into the PAYMENTS column. Other wise, the formula (CHARGE-PAYMENT) calculates a discount of the full charged amount. Thoughts?


I’m not exactly sure this is what you are intending, but the following does do something kind of like you describe:


This assumes {Payments} is, say, a payment made at the time of purchase, which triggers some sort of percentage discount, while {Payment} is a newly received payment. Based on those assumptions, the formula applies the discount, if applicable, and then subtracts the amount of the received payment. If the purchaser does not qualify for the discount, it subtracts the payment from the full charged amount. In either case, the result is the outstanding balance.

If you can’t warp that to your actual needs, let me know, and I’ll try again.


Thank you for your response! Its close but not quite. The discount is actually a WRITEOFF and will be equal to the CHARGE minus the PAYMENT only IF a payment is made/entered. If there is no payment entered, the writeoff should not be caculated (as it simply calculates the full CHARGE minus a 0 PAYMENT to give me a WRITEOFF amount equal to the orignal CHARGE which is not what I want).


Well, the standard IF() statement structure would look like this:

    [What you want if a payment was received],
    [What you want if no payment was received]

(It’s not a multi-condition IF() as the posting initially discussed.)

So essentially you’re looking at this, possibly with a second clause:

    [What you want if no payment was received]

If you don’t want a value when no payment is received, you could just use this:



Thank you!! I think that will work. I appreciate the help!