Winston Underwood
Winston Underwood

Reputation: 119

How can I multiply an array of text with an array of Boolean values in Excel?

I have a array of values that are states {"OH","VA","CA"} and an array of Boolean values {TRUE, FALSE, TRUE} and want to concatenate all the states that correspond to TRUE, so in this example my result would be "OHCA." Company policy does not allow the use of VBA (dumb, I know), so I'm trying to use an array formula. Any idea how to make this work?

Upvotes: 1

Views: 3589

Answers (2)

Adrien Burg
Adrien Burg

Reputation: 1

I allow myself to suggest this answer, that gives an answer to the title question and not to the question text because it shows in top results and I suspect it is a common topic.

A simple and elegant way to do this: =FILTER({"OH","VA","CA"}, {TRUE,FALSE,TRUE})

For the text case, just apply CONCAT() to the above suggestion.

Upvotes: 0

user4039065
user4039065

Reputation:

As an array formula with CSE,

=CONCAT(IF({TRUE,FALSE,TRUE}, {"OH","VA","CA"}, TEXT(,)))

Upvotes: 3

Related Questions