Calculated Formula for Finding three diferent results
-
30-01-2021 - |
Question
I am working on a calculated formula based on my [Tracking Number]
column to get the following results:
- Find "Andrews" return the result "ANDREWS".
- Find "Bolling" return the result "BOLLING".
- Find "Pentagon" return the result "PENTAGON".
The formula that I have come up with returns "ANDREWS" when it finds "Andrews", and returns #VALUE! for all the others.
This is the formula that I am using. Please help me resolve this issue.
=IF(FIND("Andrews",[Tracking Number]),"ANDREWS",IF(FIND("Bolling",[Tracking Number]),"BOLLING",IF(FIND("Pentagon",[Tracking Number]),"PENTAGON")))
Thanks in advance!
La solution
The FIND function is not real friendly… if there is not a match it returns an error. Here's one solution:
=IF( NOT(ISERR(FIND("Andrews",[Tracking Number]))), "ANDREWS",
IF( NOT(ISERR(FIND("Bolling",[Tracking Number]))), "BOLLING",
IF( NOT(ISERR(FIND("Pentagon",[Tracking Number]))), "PENTAGON", "none" )))
Here's an alternate solution:
=IF( ISNUMBER(FIND("Andrews",[Tracking Number])), "ANDREWS",
IF( ISNUMBER(FIND("Bolling",[Tracking Number])), "BOLLING",
IF( ISNUMBER(FIND("Pentagon",[Tracking Number])), "PENTAGON", "none" )))
Autres conseils
Seems like You are missing last ELSE part in third third IF statement
=IF(
FIND("Andrews",[Tracking Number]),
"ANDREWS",
IF(
FIND("Bolling",[Tracking Number]),
"BOLLING",
IF(
FIND("Pentagon",[Tracking Number]),
"PENTAGON",
" !!! NEED VALUE HERE !! "
)
)
)
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange