Countif Formula with multiple criteria

nabeelahmed

Board Regular
Joined
Jun 19, 2020
Messages
76
Office Version
  1. 365
Platform
  1. Windows
Dear Friends,

I am trying to use Countif for multiple criteria but unfortunately not able to do, i am able to use only for one criteria for workbook1 [ =C6&"-"&COUNTIF(C$1:C6,C6) ]
Actually i have two workbooks where i am using same serial number as entered in Workbook1 column"C" and Workbook2 Column"J"
i want that when i will use same serial number in 2nd workbook which is already in used in 1st workbook should be shown that it is already entered in 1st workbook so that there will be no duplication in serial number.

1595924390459.png


Thanks

Nabeel
 
Book1
BCDEFGHI
1WorkbookWorkbook
2
3200-1200201-2201
4200-2200201-3201
5200-3200202-1202
6200-4200200-7200
7200-5200
8201-1
9200-6
10
11
12
13
14
Sheet1
Cell Formulas
RangeFormula
G3:G6G3=H3&"-"&MAX(MAX(IFERROR(MID($B$3:$B$17,SEARCH(H3,$B$3:$B$17)^0*SEARCH("-",$B$3:$B$17)+1,999)+0,0)),MAX(IFERROR(MID($G$2:G2,SEARCH(H3,$G$2:G2)^0*SEARCH("-",$G$2:G2)+1,999)+0,0)))+1
 
Upvote 0

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"
Book1
BCDEFGHI
1WorkbookWorkbook
2
3200-1200201-2201
4200-2200201-3201
5200-3200202-1202
6200-4200200-7200
7200-5200
8201-1
9200-6
10
11
12
13
14
Sheet1
Cell Formulas
RangeFormula
G3:G6G3=H3&"-"&MAX(MAX(IFERROR(MID($B$3:$B$17,SEARCH(H3,$B$3:$B$17)^0*SEARCH("-",$B$3:$B$17)+1,999)+0,0)),MAX(IFERROR(MID($G$2:G2,SEARCH(H3,$G$2:G2)^0*SEARCH("-",$G$2:G2)+1,999)+0,0)))+1

Dear Punit, Thank you very much for your help.. Here i have one more question if you can help me for this too. if i will have one more sheet as added below workbook2 then what will be the change in formula?



1596362253027.png
 
Upvote 0
Book1
ABCDEFGHIJ
1WorkbookWorkbookWorkbook
2
3200-1200201-2201201-4201
4200-2200201-3201202-2202
5200-3200202-1202
6200-4200200-7200
7200-5200
8201-1
9200-6
10
11
12
Sheet2
Cell Formulas
RangeFormula
H3:H4H3=I3&"-"&MAX(MAX(IFERROR(MID($B$3:$B$17,SEARCH(I3,$B$3:$B$17)^0*SEARCH("-",$B$3:$B$17)+1,999)+0,0)),MAX(IFERROR(MID($H$2:H2,SEARCH(I3,$H$2:H2)^0*SEARCH("-",$H$2:H2)+1,999)+0,0)),MAX(IFERROR(MID($E$3:$E$17,SEARCH(I3,$E$3:$E$17)^0*SEARCH("-",$E$3:$E$17)+1,999)+0,0)))+1
E3:E6E3=F3&"-"&MAX(MAX(IFERROR(MID($B$3:$B$17,SEARCH(F3,$B$3:$B$17)^0*SEARCH("-",$B$3:$B$17)+1,999)+0,0)),MAX(IFERROR(MID($E$2:E2,SEARCH(F3,$E$2:E2)^0*SEARCH("-",$E$2:E2)+1,999)+0,0)))+1




But i am not so convinced with the formula as i have to short it down.

I have few Question. Are the Workbooks in Seperate Sheets or in the same Sheet. If it is in the same sheet then it can be shortened.However if the Worksheet data are in different sheet it will be cumbersome process to shorten the formula
 
Upvote 0
Book1
ABCDEFGHIJ
1WorkbookWorkbookWorkbook
2
3200-1200201-2201201-4201
4200-2200201-3201202-2202
5200-3200202-1202
6200-4200200-7200
7200-5200
8201-1
9200-6
10
11
12
Sheet2
Cell Formulas
RangeFormula
H3:H4H3=I3&"-"&MAX(MAX(IFERROR(MID($B$3:$B$17,SEARCH(I3,$B$3:$B$17)^0*SEARCH("-",$B$3:$B$17)+1,999)+0,0)),MAX(IFERROR(MID($H$2:H2,SEARCH(I3,$H$2:H2)^0*SEARCH("-",$H$2:H2)+1,999)+0,0)),MAX(IFERROR(MID($E$3:$E$17,SEARCH(I3,$E$3:$E$17)^0*SEARCH("-",$E$3:$E$17)+1,999)+0,0)))+1
E3:E6E3=F3&"-"&MAX(MAX(IFERROR(MID($B$3:$B$17,SEARCH(F3,$B$3:$B$17)^0*SEARCH("-",$B$3:$B$17)+1,999)+0,0)),MAX(IFERROR(MID($E$2:E2,SEARCH(F3,$E$2:E2)^0*SEARCH("-",$E$2:E2)+1,999)+0,0)))+1




But i am not so convinced with the formula as i have to short it down.

I have few Question. Are the Workbooks in Seperate Sheets or in the same Sheet. If it is in the same sheet then it can be shortened.However if the Worksheet data are in different sheet it will be cumbersome process to shorten the formula
Data is in different sheets
 
Upvote 0

Forum statistics

Threads
1,214,549
Messages
6,120,149
Members
448,948
Latest member
spamiki

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