How do I create an formula containing IFs, OR ANDs and lists?

Copper Contributor

Can anyone simplify this formula in the attached excel. This is just an example but the lists are very long and I wanted to see if there was a better way of doing this. Many thanks in advance it is MUCH appreciated.

10 Replies


Like this:




You can expand the range $O$3:$O$12 as needed.


As variant

=IF( (G2=$E3)*COUNTIF(O3:O12, C3),D3,0)




An alternative could be above formula.

Thank you so much for this, its much easier and I have learnt something new )
Thank you ever so much for this, i never realised you could use countif like this.
Thank you ever so much for this, i have never used a sumproduct like this before.


Although it is probable that you are not using 365 (or Excel 2021), you did not say, so this is a single dynamic array formula

= COUNTIFS(list,costCentre)
  * amount


@Hans Vogelaar 

Thank you so much for this, but can I ask you one last question. Is this the best / quickest formula to use ?

best response confirmed by Helen15 (Copper Contributor)


The formula is OK. I'd use ISNUMBER and MATCH for the range L6:L7 too; that makes it easier to add Cost Centers if necessary.



or, slightly shorter:



Thank you SO much this really has helped me no end :)