2

I have two sheets. This is the first sheet. Named 3 enter image description here

And this is the second sheet. Named centralizare enter image description here

I have to write in Sheet2 C5 the number of 'Id garantie' from Sheet1 if the 'Categorie' from Sheet1 is 'Done' (Sheet2 B5) and 'Status 1'from Sheet1 is 'In lucru' (Sheet 2 B4)

I tried this

=COUNT(INDEX('3'!$C$2:$C$99,MATCH(B5,'3'!A2:A99,0)))

but it returns only one number if only the 'Categorie' is Done.

And other method with errors

=MATCH('3'!C2:C99,(centralizare!C5='3'!B2:B96)*(D4='3'!F2:F96),0)
=INDEX('3'!$C$2:$C$99,MATCH(D5,'3'!C2:C99,0))
=COUNT(INDEX('3'!A2:A96, MATCH("In lucru",'3'!E2:E96)))
3
  • you are looking for =COUNTIFS('3'!$A$2:$A$99,B5,'3'!$C$2:$C$99,C$4)??? Commented Mar 19, 2016 at 13:47
  • I tried what you said but it returns 0 Commented Mar 19, 2016 at 13:58
  • oh sorry... in sheet '3' col B and D are hidden... I missed that... =COUNTIFS('3'!$A$2:$A$99,$B5,'3'!$E$2:$E$99,C$4) will be correct then :P Commented Mar 19, 2016 at 14:20

1 Answer 1

1

You could try an array formula with sumproduct:

=SUMPRODUCT(--IFERROR((('3'!A2:A5=centralizare!B5)),0))

Must be entered using ctrl + alt + enter. Is should appear like so in your formula bar if done right:

{=SUMPRODUCT(--IFERROR((('3'!A2:A5=centralizare!B5)),0))}

Sample workbook: https://filetea.me/t1sjZdwkvxrRxGePZmKZyB7BQ

EDIT: It also seems that you should never had "finalizat" & "wip" in the same row, if I understand your rules right. WIth the array formula, you can check for both rules & only count those that meet both rules, not just one, and somewhat check data quality this way.:

{=SUMPRODUCT(--IFERROR((('3'!A2:A5=centralizare!B5))*('3'!C2:C5=***choose a cell/range where you put a reference to finalizat/in luru instead of wip/donw***),0))}

In other words, the general format for multiple criterial is:

{=SUMPRODUCT(--IFERROR(((CRITERIA ONE)*(CRITERIA TWO)),0))}
Sign up to request clarification or add additional context in comments.

Comments

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.