You are viewing limited content. For full access, please sign in.

Question

Question

Regular Expression

asked on March 24, 2021

I am trying to populate a dollar amount in a single line field based on a selection in a radio button field. The vendor will select which kind of vendor they are, which will then populate the dollar amount in the single line field. Problem I am having is two of the values are the same amount and its putting _1 after the second one. I was thinking maybe I could write a regular expression to only grab the first two digits after the decimal. 

anyone have an idea on a regular expression that might work?

0 0

Answer

SELECTED ANSWER
replied on March 24, 2021

What am i doing wrong, its giving me a calculation error.

 

=IF(Booth_Type = A, "$100", IF(Booth_Type = B, "$100", IF(Booth_Type = C, "$90", IF(Booth_Type = D, "$325")))

 

 

0 0

Replies

replied on March 24, 2021

Easier would be to change the values to something else and use a formula to get the right number in the single line. 

Set your values to a, b, c, d or whatever else, then in the single line do

=IF( Booth_Type = a, "$100", IF( Booth_Type = b, "$100", IF(...)))

The values behind each option should just be a variable reference to which booth type was picked. Set the dollar amount on each booth type in the formula.

1 0
SELECTED ANSWER
replied on March 24, 2021

What am i doing wrong, its giving me a calculation error.

 

=IF(Booth_Type = A, "$100", IF(Booth_Type = B, "$100", IF(Booth_Type = C, "$90", IF(Booth_Type = D, "$325")))

 

 

0 0
replied on March 24, 2021

Do you need one more close parenthesis? You have 4 opens and only 3 closes

1 0
replied on March 24, 2021

That make since. I am very new to doing calculations. I tried adding one additional and its still giving an error. Should there be spaces in between the = and a 

=A

= A

0 0
replied on March 24, 2021

I got it working, when i removed spacing! thanks for your help! 

1 0
replied on March 24, 2021

Sorry, the spaces were to make it easier to read here on Answers. Definitely no spaces in the formula. I missed that in your example. 

0 0
replied on March 25, 2021

I have one more question so this formula worked. 

=IF(Booth_Type="A",100.00,IF(Booth_Type="B",100.00,IF(Booth_Type="C",90.00,IF(Booth_Type="D",325.00,))))

But say I wanted to add another field where they are putting number and multiply it by the amount calculated.  how would I do that. 

0 0
replied on March 25, 2021

You can use your Booth_Cost field now as a variable. If you have that long formula set for the field called Booth Cost, you can use

=PRODUCT(Booth_Cost,Number_of_booths_needed)

0 0
replied on March 24, 2021

Jared's suggestion is going to be the best.

But if you really want to use a regular expression, something like this would likely work: 

(\$\d*\.\d\d)
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.