PearlGI
Registered User.
- Local time
- Today, 07:17
- Joined
- Aug 30, 2001
- Messages
- 125
Hi, I've been using array formulae (formulae entered with [Ctrl]+[Shift]+[Enter]) for many years now, but can not work out how to get them to work (in just one formulae) if the value you wish to compare the array to is not a single value.
For instance, if I wish to sum the value of 'Dog' from a range containing animal weights the formulae would be:
{=SUM(IF(AnimalNameRange="Dog",AnimalWeightRange,0))}
Now what if you need the combined weight of both 'Dogs' and 'Cats'? The simple answer would be use 2 formulae and add the results together.
However, if the situation becomes more complex if you need to use many options, i.e. Dogs, Cats, Fish, Bird, Horse, etc, etc.
Surely there must be a way to combine this within a single array formulae, for instance something along the lines of:
{=SUM(IF(AnimalNameRange={ArrayToFind},AnimalWeightRange,0))}
or
{=SUM(IF(AnimalNameRange=OR(ArrayToFind),AnimalWeightRange,0))}
but try as I might nothing seems to work. Can anyone get this idea to work?
For instance, if I wish to sum the value of 'Dog' from a range containing animal weights the formulae would be:
{=SUM(IF(AnimalNameRange="Dog",AnimalWeightRange,0))}
Now what if you need the combined weight of both 'Dogs' and 'Cats'? The simple answer would be use 2 formulae and add the results together.

However, if the situation becomes more complex if you need to use many options, i.e. Dogs, Cats, Fish, Bird, Horse, etc, etc.

Surely there must be a way to combine this within a single array formulae, for instance something along the lines of:
{=SUM(IF(AnimalNameRange={ArrayToFind},AnimalWeightRange,0))}
or
{=SUM(IF(AnimalNameRange=OR(ArrayToFind),AnimalWeightRange,0))}
but try as I might nothing seems to work. Can anyone get this idea to work?