# IF Condition in formula when the data comes from different columns

This one is a head scratcher. I cannot figure it out…

I’m developing a formula column where our payables person will see a message like this: “On xx/xx date, pay \$350.00”. I get stuck trying to get the dollar amount on the formula because the amount comes from different columns, depending which payment number the project manager is trying to make .
On the board, each payment amount approved by the PM is recorded on its own payment column (e.g. pay #1 column, pay #2 column, pay #3 column, etc.). So, if this week the PM approves pay #2 for Joe Painting Company for \$350, how do I put in the formula to insert Pay #2 amount, not Pay #1 or others? At this point, Pay #1 column has already been filled out, and the other payment columns (not #2) are either empty or “0”

This is what I have so far:

``````IF({PAY STATUS}="YES PAY THIS WEEK",("On " & {TO BE PAID ON#Labels} & ", pay \$" & {INSERT APPROPRIATE PAY # COLUMN}), "")
``````

@laura1

Will it always the case that only 1 amount colunn will have a value?

If not, how do you know which one to pay?

you pay the amount on the column that is next (left of) the column that is still “zero”. For example, Pay #1 column : \$300, Pay #2 column: 350, Pay #3 column: 0
Then we know we have to pay the amount that is in Pay #2

Does it make sense? See pic below

@laura1

Got it.

So, {INSERT APPROPRIATE PAY # COLUMN} should be:
IF({Pay3} > 0, {Pay3}, IF({Pay2} > 0, {Pay2}, {Pay1}))

Jim - The Monday Man (YouTube Channel)
Watch Our Latest Video: Column Total in monday.com Formulas? YES!!!

1 Like

It worked, @JCorrell! You’re the best. I was doing it {pay1}, {pay2},{pay3} , but it didn’t work, but going backwards 3, 2, 1 did it. Thank you!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.