- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

# Switch function ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2018 05:12 AM

I have a colum with different values but i want to make a new calculated column that checks the values in the other column

i believe the switch function would work here but im not sure how to use it.

I need a few checks in the formula.

He needs to check a couple of things.

1. IF value in column 'AP gebied naam' contains 'VB_' then "Vraagbundeling"

else

2. IF value in column 'AP gebied naam' contains '-E0' then "Nieuwbouw"

else

3. "Hoofdproject"

Hopefully someone can help me out here

Solved! Go to Solution.

Accepted Solutions

## Re: Switch function ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2018 05:20 AM

General Switch Formula would be:

SWITCH(['AP gebied naam'];

"VB_";"Vraagbundeling"

"-E0";Niewbouw;

"Hoofdproject")

There is also a CONTAINS formula. But I have never used it before. So if you can give the formula the whole name of the phrase to check this should work.

All Replies

## Re: Switch function ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2018 05:20 AM

General Switch Formula would be:

SWITCH(['AP gebied naam'];

"VB_";"Vraagbundeling"

"-E0";Niewbouw;

"Hoofdproject")

There is also a CONTAINS formula. But I have never used it before. So if you can give the formula the whole name of the phrase to check this should work.

## Re: Switch function ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2018 05:35 AM

Just for perfection including contains:

=SWITCH(TRUE();

NOT(ISERROR(SEARCH("VB_";['AP gebied naam'])));"Vraagbundeling";

NOT(ISERROR(SEARCH("-E0";['AP gebied naam'])));"Nieuwbouw";

"Hoofproject")

## Re: Switch function ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2018 05:35 AM

@FloriankxCONTAINS will not help here, but your switch statement is correct and it's exactly what @RvdHeijden needs here. CONTAINS checks to see if a certain column has a certain value anywhere in the entire column. So it's not particularly useful on a row-by-row case like this one.

## Re: Switch function ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2018 06:00 AM

## Re: Switch function ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2018 06:05 AM

Hello,

it should. Please try it and let me know.

If more than one LogicalTest is true I think switch stops after the first true one.

Best regards.

## Re: Switch function ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2018 06:30 AM

No, it doesn't check substrings. The value has to literally be "VB_" or "-E0". If it's something like "VB_-E0" that won't count.