PShingadia
New Member
- Joined
- Aug 5, 2015
- Messages
- 47
Hi
Just wondered if anyone can help with a formula to count out items in a list based on a count in another range with a criteria. So in the example below the little box says how many to count in total and from the list I wish to count out that many with an added criteria and if more to show as zero. This is similar to a previous post which I have used but can't seem to get it to work with the additional criteria. So in the example below the little box says how many to count out with weight of 10 and require a formula to go down and count these out in sequence and once it reaches the number required to put zero to any others.
The formula I am using in the Result Getting column is: =IF(COUNTIFS($A$3:A3,A3,$B$3:B3,$I$8)> VLOOKUP(A3,$F$8:$G$10,2,0), 0, COUNTIFS($A$3:A3,A3,$B$3:B3,$I$8)) but this largely works but falls down at the items shown in red. The Results Required column shows what I should be getting.
Any help with tweaky this would be really appreciated.
[TABLE="width: 1076"]
<colgroup><col span="3"><col><col><col><col><col span="8"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Type[/TD]
[TD]Weight[/TD]
[TD]Result Getting[/TD]
[TD]Result Required[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Fox[/TD]
[TD]10[/TD]
[TD] 1[/TD]
[TD] 1[/TD]
[TD][/TD]
[TD="colspan: 10"][/TD]
[/TR]
[TR]
[TD]Fox[/TD]
[TD]10[/TD]
[TD] 2[/TD]
[TD] 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Fox[/TD]
[TD]10[/TD]
[TD] 3[/TD]
[TD] 3[/TD]
[TD][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D] 2[/TD]
[TD] 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dog[/TD]
[TD]20[/TD]
[TD] 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dog[/TD]
[TD]10[/TD]
[TD] - [/TD]
[TD] - [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dog[/TD]
[TD]30[/TD]
[TD] - [/TD]
[TD] - [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[TD]30[/TD]
[TD] 2[/TD]
[TD] - [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[TD]10[/TD]
[TD] 3[/TD]
[TD] 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Just wondered if anyone can help with a formula to count out items in a list based on a count in another range with a criteria. So in the example below the little box says how many to count in total and from the list I wish to count out that many with an added criteria and if more to show as zero. This is similar to a previous post which I have used but can't seem to get it to work with the additional criteria. So in the example below the little box says how many to count out with weight of 10 and require a formula to go down and count these out in sequence and once it reaches the number required to put zero to any others.
The formula I am using in the Result Getting column is: =IF(COUNTIFS($A$3:A3,A3,$B$3:B3,$I$8)> VLOOKUP(A3,$F$8:$G$10,2,0), 0, COUNTIFS($A$3:A3,A3,$B$3:B3,$I$8)) but this largely works but falls down at the items shown in red. The Results Required column shows what I should be getting.
Any help with tweaky this would be really appreciated.
[TABLE="width: 1076"]
<colgroup><col span="3"><col><col><col><col><col span="8"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Type[/TD]
[TD]Weight[/TD]
[TD]Result Getting[/TD]
[TD]Result Required[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Fox[/TD]
[TD]10[/TD]
[TD] 1[/TD]
[TD] 1[/TD]
[TD][/TD]
[TD="colspan: 10"][/TD]
[/TR]
[TR]
[TD]Fox[/TD]
[TD]10[/TD]
[TD] 2[/TD]
[TD] 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Fox[/TD]
[TD]10[/TD]
[TD] 3[/TD]
[TD] 3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]10[/TD]
[TD] 2[/TD]
[TD] 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dog[/TD]
[TD]20[/TD]
[TD] 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dog[/TD]
[TD]10[/TD]
[TD] - [/TD]
[TD] - [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dog[/TD]
[TD]30[/TD]
[TD] - [/TD]
[TD] - [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[TD]30[/TD]
[TD] 2[/TD]
[TD] - [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[TD]10[/TD]
[TD] 3[/TD]
[TD] 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]