1

I'm putting together a sheet that calculates whether a group of enterprises meets certain turnover thresholds in several countries.

Column A are the countries (line 2=global; line 4-34 = EU member states); columns C-H are each enterprise's turnover (globally and in each EU member state).

Four criteria must be met, I'm struggling with no (iii). By way of background, criterion (ii) is:

(ii) a combined turnover of all the merging firms over € 100 million in each of at least three Member States

I found the solution for this here.

{=IF(SUM(IF(MMULT(C4:H31+0;TRANSPOSE(COLUMN(C4:H31)^0))>=100*10^6; 1; 0))>=3; TRUE; FALSE)}

Criterion (iii) is

(iii) a turnover of over €25 million for each of at least two of the firms in each of the three Member States included under (ii)

When splitting up the two criteria in their own arrays I get correct true/false values for each country: Combined turnover over 100 Mio in a member state

{=IF(MMULT(C4:H31+0;TRANSPOSE(COLUMN(C4:H31)^0))>=100*10^6;TRUE;FALSE)}

and

turnover for each of at least two of the firms of more than 25 Mio in a member state

{=IF((MMULT(IF(C4:H31>=25*10^6;1;0);TRANSPOSE(COLUMN(C7:H34)^0)))>=2;TRUE;FALSE)}

However combining these two formulas into one with IF(AND()) doesn't work

{=IF(AND(MMULT(C4:H31+0;TRANSPOSE(COLUMN(C4:H31)^0))>=100*10^6;(MMULT(IF(C4:H31>=25*10^6;1;0);TRANSPOSE(COLUMN(C4:H31)^0)))>=2);TRUE;FALSE)}

Is there a way of doing this, either by using arrays (preferred) or VBA?

Thanks a lot!

ElEsido

1 Answer 1

0

Your two formulae work fine separately as you say. What they are both doing is to give you a column vector of 1's and 0's which you can get a count from just by summing the elements.

To combine them you need to do a scalar multiply of each pair of elements so that you end up with another column vector which you can count in the same way so it looks like this:-

=SUM(IF(MMULT(C4:H10+0,TRANSPOSE(COLUMN(C4:H10)^0))>=100, 1, 0)*IF((MMULT(IF(C4:H10>=25,1,0),TRANSPOSE(COLUMN(C7:H10)^0)))>=2,1,0))

To keep things simple I have been testing it just on a few lines of data so you will need to scale it up to your actual data and put the millions back in.

enter image description here

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

1 Comment

Thank you very much, Tom! Taking your formula and putting it into a IF(...>=3;TRUE;FALSE) exactly gives me what I need! Thank you again!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.