cancel
Showing results for
Did you mean:
Helper III

How to Prevent Formula from Calculating If Not number

Good day,

I have a formula looking at multiple, single line text.  ( i need single line text to allow user to input some values sometimes with text due to unit inconsistencies)

I would like the formula NOT to calculate when there a text or if it is blank. Or basically only calculate when all are Numbers.

I am trying to use !isnumeric but it seems not to be working.

Thank you.

Edit - it seems isnumeric is something working, will reply if i got it to work

1 ACCEPTED SOLUTION

Accepted Solutions

Yes you can use IsNumeric

If you want sometimes to try and convert Text to Number initially and then fall back to not calculating if it fail, try using Value (this gives Blank() if the conversion fails, which can be checked by IsBlank)

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-value

Example - If someone enters 12.34%, Value("12.34%") converts it to 0.1234 instead of having to manually check for or handle this in some other way.

See if above helps in case.

2 REPLIES 2

Yes you can use IsNumeric

If you want sometimes to try and convert Text to Number initially and then fall back to not calculating if it fail, try using Value (this gives Blank() if the conversion fails, which can be checked by IsBlank)

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-value

Example - If someone enters 12.34%, Value("12.34%") converts it to 0.1234 instead of having to manually check for or handle this in some other way.

See if above helps in case.

Helper II

In my case i have this formula,

Set(
vary,
Round(
If Error(
((DataCardValue159.Text - DataCardValue160.Text) / DataCardValue159.Text),
0
) * 100,
2
)
)

when any one of the data cards is blank I don't want the formula to calculate. But when (DataCardValue159.Text) is not blank and (DataCardValue160.Text) is blank its calculating the formula.  I tried using If conditions, but it seems not to be working.

Any help is greatly appreciated.

Announcements