# Formula To Calculate Combinations

#### honkin

##### Board Regular
I need to put a formula together which does the following, but am struggling.

Here is what is required.

Columns U, V & W have either an X or are blank. I want to put the result of varying combinations of the Xs in another column.

So In English, IF W2 =X, then the result will be x. If U2 & V2 both have an X, the result will be **, otherwise the result will be *

Just to clarify, if there is an X in column W, the will never be an X in U or V. If there is an X in either U or V, there will never be an X in W.

Only 3 possibly scenarios exist

1) U2=X, V2=X, W2=Blank - Result =**
2) U2=X, V2=Blank, W2=Blank - Result = *
3) U2=Blank, V2=Blank, W2=X - Result = x

I tried starting with
VBA Code:
``=IF(W2="X",x,IF(AND(U2="X",V2="X"),"**","*"))``
but the result gives me #NAME? I thought this was saying IF W2 = "X" put x, IF U2="X" AND V2="X" then put "**", otherwise put "*"

cheers

### Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

#### JoeMo

##### MrExcel MVP
The lower case x needs quote marks around it. If(W2="X","x" .....

• honkin

#### honkin

##### Board Regular
ah cheers JoeMo. Had looked at it for so long and just couldn't see it.

Thanks again

#### JoeMo

##### MrExcel MVP
You are welcome - thanks for the reply.

Replies
3
Views
134
Replies
2
Views
116
Replies
2
Views
76
Replies
2
Views
77
Replies
4
Views
38