# Number range indicates text need help

This topic is 6990 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

Hello

I have a field with is called priority code. "PC" I have another calculation field which is called "TEXTCODE"

the numbers are sequential from 1 to 7 and then they are ranges like 13-15

I have statements to be calculated to the field "TEXTCODE" and I need help writing them because they are lot.

The table is this

1= "RED"

2= "GREEN"

but

7-10 = "BLUE"

So if the user enters in 8 it would be " Blue " in the text field

I have to write this formula and i need help

Thanks

Dave

##### Share on other sites

Using the examples you provided one way would be a Case statement.

TEXTCODE = Case(

PC = 1; "RED";

PC = 2; "GREEN";

PC > 6 and PC < 11; "Blue")

Another way would be to create a PC table with two fields PC and TEXTCODE. Record one PC =1, TEXTCODE = RED, record two PC = 2, TEXTCODE = GREEN etc. Then relate this new PC table to your main table by PC = PC, TEXTCODE in the main table would be a calcualtion = PC::PC.

##### Share on other sites

This is a good place for the case statement.

Something like this:

Case (

PC >= lowest number in highest range; Color for highest range;

PC >= lowest number in next highest range; Color for next highest range;

and so on

PC >= 7; "Blue";

PC = 6; Color for 6

and so on

PC = 2; "Green";

PC = 1; "Red" )

##### Share on other sites

This topic is 6990 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account