How to use count ifs with if condition for multiple sheets?

Dave Smith

New Member
Joined
Jul 5, 2021
Messages
32
Office Version
  1. 2016
Platform
  1. Windows
Hi Experts,

I need one help if any body can help i will be grateful for that.
If I try to explain my data I have multiple sheets which is working as database and now i am creating a dashboard where the specific number of items is need to counted from this based on year month and date & for year month and week i have tried to make the combobox.

I have tried to do this formula using first count if and then if formula but it is little bit more confusing as well as it is tedious as it need to have one specific sheet for the rough data (like to join various name or condition to search etc). I think this can be done in much better way with vba which will be more effective and no need of having any rough sheet to store or to calculate all this stuffs.

I think i have tried to explain my problem & Pl. let me know if there is any need of more data required.
Pl. find images of dashboard and database in attached images.

Pl. help me i need to sort out plz. by 21st feb.

Regards,
Dave
 

Attachments

  • Dasboard_image.jpg
    Dasboard_image.jpg
    125.3 KB · Views: 12
  • Database_1_image.jpg
    Database_1_image.jpg
    230.7 KB · Views: 13
  • Database_2_image.jpg
    Database_2_image.jpg
    226 KB · Views: 12

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
This is a formula solution only if you can use it

You could create a tab called "Appended", you can either manually copy both database_1 & 2 data into this new table1, convert this into an excel table.

Alternatively if you're confident with Power query you can append your databases together into one table to calculate from.

When entering the countifs it's easier to enter the formula into 1 cell 1st, then highlight the whole range and enter with CTRL + ENTER.

Note that the Month date is 01/01/2021 formatted as "January-21"

Book1
ABCD
1Database for item
2Sr No.DateBrandproduct name
311/01/2020GHTSpanner(M10)
422/01/2020HYTSpanner(M16)
533/01/2020WDTSpanner(M30)
644/01/2020BHJSpanner(M65)
755/01/2020KMJOiIPlug(M30)
866/01/2020ALMNail(B46)
977/01/2020INBNut(M15)
1088/01/2020OCVBolt(M96)
1199/01/2020OLMSpanner(M10)
121010/01/2020UBHSpanner(M16)
131111/01/2020QNGSpanner(M30)
141212/01/2020RVHSpanner(M65)
151313/01/2020GHTOiIPlug(M30)
161414/01/2020HYTNail(B46)
171515/01/2020WDTNut(M15)
database_1


Book1
ABCD
1Database for item
2Sr No.DateBrandproduct name
311/01/2021GHTSpanner(M10)
422/01/2021HYTSpanner(M16)
533/01/2021WDTSpanner(M30)
644/01/2021BHJSpanner(M65)
755/01/2021KMJOiIPlug(M30)
866/01/2021ALMNail(B46)
977/01/2021INBNut(M15)
1088/01/2021OCVBolt(M96)
1199/01/2021OLMSpanner(M10)
121010/01/2021UBHSpanner(M16)
131111/01/2021QNGSpanner(M30)
141212/01/2021RVHSpanner(M65)
151313/01/2021GHTOiIPlug(M30)
161414/01/2021HYTNail(B46)
171515/01/2021WDTNut(M15)
database_2


Book1
ABCDE
1Sr No.DateBrandproduct nameWeeknumber
211/01/2020GHTSpanner(M10)1
322/01/2020HYTSpanner(M16)1
433/01/2020WDTSpanner(M30)1
544/01/2020BHJSpanner(M65)1
655/01/2020KMJOiIPlug(M30)2
766/01/2020ALMNail(B46)2
877/01/2020INBNut(M15)2
988/01/2020OCVBolt(M96)2
1099/01/2020OLMSpanner(M10)2
111010/01/2020UBHSpanner(M16)2
121111/01/2020QNGSpanner(M30)2
131212/01/2020RVHSpanner(M65)3
141313/01/2020GHTOiIPlug(M30)3
151414/01/2020HYTNail(B46)3
161515/01/2020WDTNut(M15)3
1711/01/2021GHTSpanner(M10)1
1822/01/2021HYTSpanner(M16)1
1933/01/2021WDTSpanner(M30)2
2044/01/2021BHJSpanner(M65)2
2155/01/2021KMJOiIPlug(M30)2
2266/01/2021ALMNail(B46)2
2377/01/2021INBNut(M15)2
2488/01/2021OCVBolt(M96)2
2599/01/2021OLMSpanner(M10)2
261010/01/2021UBHSpanner(M16)3
271111/01/2021QNGSpanner(M30)3
281212/01/2021RVHSpanner(M65)3
291313/01/2021GHTOiIPlug(M30)3
301414/01/2021HYTNail(B46)3
311515/01/2021WDTNut(M15)3
Appended
Cell Formulas
RangeFormula
E2:E31E2=WEEKNUM(B2)-WEEKNUM(EOMONTH(B2,-1)+1,1)+1


Book1
ABCDEFGHI
5
6YEAR2021MonthJanuary-21week2
71/01/2021
8
9
10
11Spanner(M16)Spanner(M16)Bolt(M96)Nail(B46)OiIPlug(M30)Spanner(M10)Spanner(M10)
12BrandGHTWDTOCVHYTGHTGHTOLM
13Number of Item/year0011111
14Number of Item/month0011111
15Number of Item/week0010001
16
Dashboard
Cell Formulas
RangeFormula
F7F7=F6
C13:I13C13=COUNTIFS(Table1[Date],">="&DATE(Dashboard!$B$6,1,1),Table1[Date],"<="&DATE(Dashboard!$B$6+1,1,1)-1,Table1[Brand],Dashboard!C$12,Table1[product name],Dashboard!C$11)
C14:I14C14=COUNTIFS(Table1[Date],">="&$F$6,Table1[Date],"<="&EOMONTH($F$6,0),Table1[Brand],Dashboard!C$12,Table1[product name],Dashboard!C$11)
C15:I15C15=COUNTIFS(Table1[Date],">="&$F$6,Table1[Date],"<="&EOMONTH($F$6,0),Table1[Brand],Dashboard!C$12,Table1[product name],Dashboard!C$11,Table1[Weeknumber],Dashboard!$I$6)
 
Upvote 0
Thank you @RasGhul For your wonderful solution but i need less formula one because in future if I or some other will try to solve this formula puzzle it will be difficult at that time to recall.
Instead of that is it possible to club all data in one sheet and use pivot table?
there data addition in database is done twice a day

Regards,
Dave
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

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