Is it possible to format "<" and ">" stored in String type for comparison?

I have Excel file that contains values includeing inequality signs as shown in the image below, and I would like to be able to use these inequality signs to judge if statements.

2021-11-20 (2)

Originally, I was going to use a switch or if activity, but my boss said, “Can’t you just use it directly?” So I’m currently looking for a way to use this String inequality sign directly in formulas.

Is there any good way to do this?

Thank you for reading

Hi,

You can use directly less takhan or greater than in if condition. Since the values will come string we have to convert to integer before checking condition. Refer below post for reference.

Hi,

There are some ways to achieve it. One of them is to use DataTable.Compute method as the following. However, it’s not very good for maintainability, I think.

Sample20211121-1.zip (2.8 KB)

Regards,

1 Like

My suggestion:
Go with your gut and ignore the boss :stuck_out_tongue:

What you want is to typeCast a string into an operator. And since an operator technically isn’t a datatype it is pretty hard to do. You end up in writing either more code, or more complex code then your initial thought of defining a switch and a few if/then’s. (Think of maintainability). There is a limited number op logical operators so it shouldn’t be too hard.

Unless of course your boss knows the short sollution to this :wink:

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