Count if help required for multiple values

Krishnab4u

New Member
Joined
Jul 16, 2018
Messages
34
Dear All,

say i have a model master like below
[TABLE="width: 500"]
<tbody>[TR]
[TD]Model Code[/TD]
[TD]Model Name[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]mustang[/TD]
[/TR]
[TR]
[TD]4321[/TD]
[TD]fortuner[/TD]
[/TR]
</tbody>[/TABLE]

i have a table like below, where i have to capture the quantity of stock of each model name from Database
[TABLE="width: 500"]
<tbody>[TR]
[TD]Model Name[/TD]
[TD]Stock Quantity[/TD]
[/TR]
[TR]
[TD]Mustang[/TD]
[TD]=Countif(??) (status as Stock only)[/TD]
[/TR]
[TR]
[TD]Fortuner[/TD]
[TD]=Countif(??) (status as Stock only)[/TD]
[/TR]
</tbody>[/TABLE]

however, my database will have only Model Code like below
[TABLE="width: 500"]
<tbody>[TR]
[TD]model code[/TD]
[TD]color[/TD]
[TD]status[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]white[/TD]
[TD]Stock[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]blue[/TD]
[TD]Invoiced[/TD]
[/TR]
[TR]
[TD]4321[/TD]
[TD]red[/TD]
[TD]Stock[/TD]
[/TR]
</tbody>[/TABLE]

One simpler way is i can do vlookup with my Model Master to add Model Name as last column in Database.
I dont want to do that for some reason.
Kindly help.


****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="width: 500"]
<tbody>[TR]
[TD]Model Name[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]mustang[/TD]
[/TR]
[TR]
[TD]4321[/TD]
[TD]fortuner[/TD]
[/TR]
</tbody>[/TABLE]
</body>
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Advise: Instead of putting up suggestions like
=Countif(??) (status as Stock only), try to post the desired values for the data sample.
 
Upvote 0
Hi,
noted.
The desired value is as follows.
[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD]Model Name[/TD]
[TD]Stock Quantity[/TD]
[/TR]
[TR]
[TD]Mustang[/TD]
[TD]= 1[/TD]
[/TR]
[TR]
[TD]Fortuner[/TD]
[TD]= 1[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Book1
ABCDEFG
1Model CodeModel Namemodel codecolorstatusModel NameStock Quantity
21234mustang1234whiteStockMustang1
34321fortuner1234blueInvoicedFortuner1
44321redStock
5
Sheet1


G2, copied down:

=COUNTIFS($E$2:$E$4,"stock",$C$2:$C$4,VLOOKUP(F2,CHOOSE({1,2},$B$2:$B$3,$A$2:$A$3),2,0))
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,269
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top