Multiple conditions and min data search

Bazabelle

New Member
Joined
Oct 6, 2022
Messages
34
Office Version
  1. 365
Platform
  1. Windows
I want to first be sorry for the image, I tried the XL2BB but microsoft blocks it and I cannot use it.

In the image 1 I have added the table I would like to fill and the formula I am searching. The image 2 is the sheet where the raw data is.

Q1 - I want for the country in Sheet 1 to find the min value in column E or G of that country in Sheet 2​
Q2 - I want to count for the country in Sheet 1 all the rows that includes a date for that country in Sheet 2 for Column F​

Hope this make sense, thank you in advance
 

Attachments

  • Sheet 1.png
    Sheet 1.png
    30.6 KB · Views: 8
  • Sheet 2.png
    Sheet 2.png
    37.5 KB · Views: 8

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try this:

Book1 (version 2).xlsb
ABC
2Canada12-Jan-233
3France01-Jan-231
4Japan09-Sep-221
Main
Cell Formulas
RangeFormula
B2:B4B2=MIN(FILTER(FILTER('Raw Data'!$E$2:$G$7,A2='Raw Data'!$B$2:$B$7),{1,0,1}))
C2:C4C2=COUNTIFS('Raw Data'!$B$2:$B$7,A2,'Raw Data'!$F$2:$F$7,"<>")
 
Upvote 0
Try:

In cell B2
Excel Formula:
=LET(b, 'Raw data'!$B$2:$B$7,a,HSTACK(VSTACK(b,b),VSTACK('Raw data'!$E$2:$E$7,'Raw data'!$G$2:$G$7)),MIN(IF(CHOOSECOLS(a,1)=A2,CHOOSECOLS(a,2))))

In cell D2
Excel Formula:
=COUNTIFS('Raw data'!$B$2:$B$7,A2,'Raw data'!$F$2:$F$7,B2)
 
Upvote 0
=COUNTIFS('Raw data'!$B$2:$B$7,A2,'Raw data'!$F$2:$F$7,B2)
why B2? I need to search for date format, I tried using the "d-mmm-yy" and it is not working and if I use "<>" it will return data that are not a date but has text in the cell
 
Upvote 0
=MIN(FILTER(FILTER('Raw Data'!$E$2:$G$7,A2='Raw Data'!$B$2:$B$7),{1,0,1}))
so in my original document (not the image I gave) the columns are not together, so this would not properly work, I should have said this or gave the example with separated columns. For the 2nd one, it would work but then if I have text other then a date it would count it, why I was searching with date format rather then taking out blanks.
 
Upvote 0
if I use "<>" it will ...
I think you confused my answer. In my formula I do not have the symbol <>

It would help if you put the expected results, since the columns in image 1 are empty and I am assuming where you want the result of Q1 and where you want the result of Q2.
 
Upvote 0
How does this differ from what you suggest you want?

Book1 (version 2).xlsb
ABCDEFGH
1IDCountryNameDeptData1Data2Data3Data4
2123France01-Jan-2309-Jan-2303-Mar-2315-Mar-23
3456France14-Apr-2323-Apr-2323-Apr-23
4789Canada06-May-2312-Apr-2301-Apr-23
5987Canada12-Jan-2331-Jan-2318-Jan-2318-Jan-23
6654Japan15-Sep-2215-Sep-2209-Sep-2222-Sep-22
7321Canada15-Mar-2331-Mar-2331-Mar-23
Raw Data


Book1 (version 2).xlsb
ABC
1CountryQ1Q3
2Canada12-Jan-233
3France01-Jan-231
4Japan09-Sep-221
Main
Cell Formulas
RangeFormula
B2:B4B2=MIN(FILTER(FILTER('Raw Data'!$E$2:$G$7,A2='Raw Data'!$B$2:$B$7),{1,0,1}))
C2:C4C2=COUNTIFS('Raw Data'!$B$2:$B$7,A2,'Raw Data'!$F$2:$F$7,"<>")
 
Upvote 0
How does this differ from what you suggest you want?

Book1 (version 2).xlsb
ABCDEFGH
1IDCountryNameDeptData1Data2Data3Data4
2123France01-Jan-2309-Jan-2303-Mar-2315-Mar-23
3456France14-Apr-2323-Apr-2323-Apr-23
4789Canada06-May-2312-Apr-2301-Apr-23
5987Canada12-Jan-2331-Jan-2318-Jan-2318-Jan-23
6654Japan15-Sep-2215-Sep-2209-Sep-2222-Sep-22
7321Canada15-Mar-2331-Mar-2331-Mar-23
Raw Data


Book1 (version 2).xlsb
ABC
1CountryQ1Q3
2Canada12-Jan-233
3France01-Jan-231
4Japan09-Sep-221
Main
Cell Formulas
RangeFormula
B2:B4B2=MIN(FILTER(FILTER('Raw Data'!$E$2:$G$7,A2='Raw Data'!$B$2:$B$7),{1,0,1}))
C2:C4C2=COUNTIFS('Raw Data'!$B$2:$B$7,A2,'Raw Data'!$F$2:$F$7,"<>")
So I think I will have to give a more concrete example later today, the document I have for work I cannot send to my personal email. but essentially I have a couple of columns in between the 2 data I want to return the min and in those columns I will also need to gather min of it on a separate cell, when I tried your formula on that work sheet and not the simple version I gave there is #value error.
 
Upvote 0

Forum statistics

Threads
1,215,227
Messages
6,123,739
Members
449,116
Latest member
alexlomt

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