Forum Discussion
fonsogijon
3 years agoFrequent Visitor
Check if more than one column has value
Hello,
I have created a calculated table as follows and I would like to create a calculated column called "Repeated" doing the following:
| ID | Col1 | Col2 | Col3 | Col4 | Repeated |
| AAA | 1 | ||||
| BBB | 1 | 2 | Yes | ||
| CCC | 3 | 5 | Yes | ||
| DDD | 4 | ||||
| EEE | 3 | 6 | Yes | ||
| FFF | 2 | 5 | 1 | Yes |
[Repeated] would be a calculated column that if two or more columns contains a value then it returns "Yes".
All rows have value, but only want to get where rows has values in two or more columns.
The way I was doing it was using IF:
Repeated = IF([Col1]>0 && [Col2]>0,"Yes",IF([Col1]>0 && [Col3]>0,"Yes",IF([Col3]>0 && [Col2]>0,"Yes")))
But I did when have 3 columns, now I have 4 and I can have more in the future, so I'm asking if you know a better way and simpler way to get that goal.
Thank you in advance!!
I have just realized I can do it with CONCATENATE and LEN:
IF(LEN(CONCATENATE([Col1], CONCATENATE( [Col2], CONCATENATE([Col3], [Col4]))))>=2,"Yes")
1 Reply
- fonsogijonFrequent Visitor
I have just realized I can do it with CONCATENATE and LEN:
IF(LEN(CONCATENATE([Col1], CONCATENATE( [Col2], CONCATENATE([Col3], [Col4]))))>=2,"Yes")