2

Im working on what I thought would be a fairly straight forward arrayformula where I only needed a single cell entry instead of having to copy it down to 100+ rows.

I am working on a spreadsheet for use with the beast shape, elemental body, and plant shape spells in Pathfinder.

My table looks like

_________A___________B________C

1___Spell name_____Type_____Size

Where A2 will contain the arrayformula. B2:B will contain Animal, Plant, Elemental, Magical Beast. C2:C will contain the range of sizes.

I have tried

ARRAYFORMULA(if(B2:B<>"",CONCATENATE(if(AND(B2:B="Animal", OR(C2:C="Small", C2:C="Medium")),"Beast Shape 1","Fail BS1"),if(AND(B2:B="Animal", OR(C2:C="Tiny", C2:C="Large")),"Beast Shape 2","Fail BS2")),"Fail Other"))

and

=ARRAYFORMULA(if(B2:B<>"",if(and(B2:B="Animal",C2:C="Small"),"Beast Shape 1", "not"), "if fail"))

But they produce incorrect output. I have tried several others as well but with various issues, usually not being propagated down all the cells, or just having the wrong information. Even when I try using only a single statement.

Originally my plan was to have a concat statement which contained multiple if statements which would produce the spell name or nothing. It looked something like

arrayformula(if(b2:b<>"",concatenate(if(and(b2:b="Animal",OR(c2="small",c2="medium")), "Beast shape 1", ""), if(and(b2:b="Animal",OR(c2="tiny",c2="large")), "Beast shape 2", ""))

However the output is wrong, and I havent been able to figure out why. Ive seen comments in places which suggests AND and OR are not valid as they have single output statements, and that concatenate must be replaced with &, but even when those are removed it does not work.

0

1 Answer 1

5

Replace AND with * and OR with +:

if(and(b2:b="Animal",OR(c2="small",c2="medium"))

becomes:

if( (b2:b="Animal") * ((c2:c="small") + (c2:c="medium")) )

must work with that.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much. I didnt encounter that knowledge anywhere else

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.