Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need formula help! 1

Status
Not open for further replies.

glh123

Technical User
May 12, 2010
5
US
I'm trying to create a formula so that 1 equals a set of words, 2 equals a different set of words, 3 equals another set of words, etc. I tried using an If Then Else function but keep getting an error. I can't seem to find anything else close to what I'm needing. Someone please help me!!
 
Can you give an example of some data and the results you are hoping to get?
thanks
 
I work in Records Management and am creating a report that shows the statuses of all of our current destruction batches. For some reason though, each status is presented as numbers. So it shows batch A as "1". 1 actually means "Batch Created". Then Batch B is shown as "2" which means "Notifications Sent" and so on. there are 6 different status types. So I need a report that instead of looking like the following:

"Batch A - 1"
"Batch B - 2"

actually needs to look like:

"Batch A - Batch Created"
"Batch B - Notifications Sent"

I tried a formula that says:
if "1" then "Batch Created"
If "2" then "Notifications Sent"

but I'm getting errors. Not sure if I'm just leaving something out that I'm not aware of... Hope this makes sense.
 
Well I was able to do the first number, but when I try to do the next number, I get the error "The remaining text does not appear to be a part of the formula".

I guess now my question is how do I list all of them? Or do I have to create a separate formula for each number?
 
YOu need an else

if "1" then "Batch Created" else
If "2" then "Notifications Sent"

Ian
 
Your formula should read:
If {table.field}="1" then "Batch Created' else
(IF {table.field}="2" then "Notifications Sent" else
(etc etc etc
))

You also might want to consider using case instead of if/then.

If isnumeric({table.field}) then
(
select({table.field})
CASE 1 : "Batch Created"
CASE 2 : "Notifications Sent"
CASE 3 : "etc"
Default : "error"
)
else "not numeric
 
When I add "else" I get the error "The formula result must be a number".
 
Thank you so much! I was leaving out the extra parentheses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top