# Help with an IF formula?

Sorry…this is probably so simple but my brain cannot figure it out this morning. I am working on an ingredient tracker. Folks can enter the item in lbs. or grams. Ultimately, I need the answer in grams. So I want to say "If entered in lbs, convert to grams. Otherwise, leave as grams. " I thought it might be better to have two columns (lbs and grams) and then a 3rd grams column.

Screenshot attached.

Thx!

Maybe this could work

(From my quick search, as lb is not a unit we use here, 1 lb = 453.59237 g)

``````If(
// if there's a value in thisRow.[Purchase in lbs.]
thisRow.[Purchase in lbs.],
// converts the lb(s) in g
thisRow.[Purchase in lbs.] * 453.59237,
// else, return the g
thisRow.[Purchase in grams]
)
``````

Or

``````If(
thisRow.[Purchase in lbs.].IsNotBlank(),
// converts the lb(s) in g
thisRow.[Purchase in lbs.] * 453.59237,
// else, return the g
thisRow.[Purchase in grams]
)
``````

You are a star, thank you! Trying this now.

My pleasure @Hope_Lawrence1 !

1 Like

It worked! Thanks!

My pleasure once again @Hope_Lawrence1 !
Glad to know it works as expected and helped you moving forward !

2 Likes

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