IF Statement formula
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have data that looks like this:
Record | Region | Country of Sale |
1 | North America | USA |
2 | North America | USA |
3 | North America | USA |
4 | North America | USA |
5 | South America | USA |
6 | North America | USA |
I added the formula tool to create an IF statement to change the incorrect region name, it looks like:
If [Region]="South America" and [Country of Sale]="USA" then [Region]="North America" else [region] Endif
output column selected: Region; data preview: North America
and my output fixes the problem, but it is throw a 0 in a different record like:
Record | Region | Country of Sale |
1 | North America | USA |
2 | North America | USA |
3 | North America | USA |
4 | 0 | USA |
5 | North America | USA |
6 | North America | USA |
Not sure how to fix this problem.
Solved! Go to Solution.
- Labels:
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I would just use the Formula Tool to update [Region] using,
if [Country of Sale]='USA'
then 'North America'
else [Country of Sale]
endif
Hope this solves it!
Thanks,
Phil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It worked, thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The important thing here to remember is that you don't need to have the [Region]="North America" part. The fact that you are using the formula tool you are starting with a field and whatever formula you type will be what sets the value for that field. You would (just like @PhilipMannering did) say if it's USA then its North America. Hopefully that makes sense 😉
