countif

jswaim

Board Regular
Joined
Sep 27, 2002
Messages
141
Hi, I am working with some data, and need to find certain models, that have a certain option code, and are below an MSRP of $35,000. The model code is in column A, Option codes are in column B, and MSRP, is in Column E. Below is an example. The option I need code is the last one in column B (1SJ). I have hundred of similar units at different prices. So, Here is what I need to determine, How may CC15936's do I have with the 1SJ option, that are below an MSRP of $34,000 dollars. Thanks in advance for your help.

Also, I would like you all to know, that I have many different models as well, so a simple countif will not work.

(Column A) CC15936
(Column B)AE7,AG1,B30,CJ3,C49,DL8,EN4,FE9,GT4,K34,LM7,M30,PDE,PF9,QMJ,R9U,SAF,T96,UB0,VB3,V54,V76,WBH,ZW9,ZY1,Z82,1SJ
(Column C) 34,000[/list]
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Book1
ABCD
1MODELOPTIONMSRPResult
2CC159361SJ33900
3CC159372SJ339002
4CC159383SJ33901
5CC159361SJ33902
6CC159402SJ33903
7CC159413SJ33904
8CC159421SJ33905
9CC159432SJ33906
10CC159443SJ33907
11CC159451SJ33908
12CC159462SJ33909
13CC159473SJ33910
14CC159481SJ33911
15CC159492SJ33912
16CC159503SJ33913
17CC159361SJ34014
18CC159362SJ34015
19CC159373SJ34016
20CC159381SJ34017
21CC159392SJ34018
22CC159403SJ34019
23CC159411SJ34020
Sheet1

Is this what you need?
 
Upvote 0
I think this may work, I will let you know tomorrow. The only thing that concerns me is that in the options column (1SJ). I have many other option codes and need to isolate the 1SJ option. For example, in the same cell I will have options ABX, NTY, EAB, and 1SJ. Anyway, I will try the code tomorrow and let you know. Thank you for your help. Jason
 
Upvote 0
Ah, I see your dilema. Well, I'm not smart enough to do it all in one formula, but, you could do:-
Book1
ABCDEF
1ModelOptionMSRPFormula1Formula2
2CC15936ABX,NTY,EAB,and1SJorABC339991SJ1
3
Sheet1
With:-
Code:
=IF(ISERROR(LEFT(SUBSTITUTE(B2,LEFT(B2,FIND("1SJ",B2)-1),""),3)),"",LEFT(SUBSTITUTE(B2,LEFT(B2,FIND("1SJ",B2)-1),""),3))

=SUMPRODUCT((A2:A23="CC15936")*(D2:D23="1SJ")*(C2:C23<34000))
 
Upvote 0
Ok, instead of:-
Code:
=IF(ISERROR(LEFT(SUBSTITUTE(B3,LEFT(B3,FIND("1SJ",B3)-1),""),3)),"",LEFT(SUBSTITUTE(B3,LEFT(B3,FIND("1SJ",B3)-1),""),3))
you can use:-
Code:
=IF(ISERROR(MID(B2,FIND("1SJ",B2),3)),"",MID(B2,FIND("1SJ",B2),3))
 
Upvote 0
tbardoni said:
Ok, instead of:-
Code:
=IF(ISERROR(LEFT(SUBSTITUTE(B3,LEFT(B3,FIND("1SJ",B3)-1),""),3)),"",LEFT(SUBSTITUTE(B3,LEFT(B3,FIND("1SJ",B3)-1),""),3))
you can use:-
Code:
=IF(ISERROR(MID(B2,FIND("1SJ",B2),3)),"",MID(B2,FIND("1SJ",B2),3))

Todd,

Using MATCH is easier...
Book4
ABCDEFGH
1MODELOPTIONMSRP
2CC15936AE7,AG1,B3033900CC159361SJ340003
3CC15937ISJ,GT433900
4CC15938WBH,ZW9,ZY133901
5CC15936CJ3,1SJ,UB033902
6CC15940EN433903
7CC15941K34,1SJ33904
8CC159421SJ33905
9CC15943LM7,PF933906
10CC15936M30,B3033907
11CC159361SJ37060
Sheet1


The formula in H2 is:

=SUMPRODUCT(($A$2:$A$11=E2)*(ISNUMBER(MATCH("*"&F2&"*",$B$2:$B$11,0)))*($C$2:$C$11< G2))
 
Upvote 0
Hey Thank You all for your assistance.
The formula from Aladin works like a charm. Thanks again.
Aladin Akyurek
 
Upvote 0
Okay, I find a little problem, not in the formula, but in what information I need to find. Here is the formula that works =SUMPRODUCT(($A$2:$A$3041=V9)*(ISNUMBER(MATCH("*"&W9&"*",$B$2:$B$3041,0)))*($G$2:$G$3041>=X9)). The problem I now have is determining how many units I have inbetween a price range such as 34,000 to 36,000 dollars, and suggestions as to how I can modify the formul to determine this information? Thanks again.
 
Upvote 0
jswaim said:
Okay, I find a little problem, not in the formula, but in what information I need to find. Here is the formula that works =SUMPRODUCT(($A$2:$A$3041=V9)*(ISNUMBER(MATCH("*"&W9&"*",$B$2:$B$3041,0)))*($G$2:$G$3041>=X9)). The problem I now have is determining how many units I have inbetween a price range such as 34,000 to 36,000 dollars, and suggestions as to how I can modify the formul to determine this information? Thanks again.

Which cells house the dollar criteria? And fow which must these criteria hold -- G2:G3041?
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,181
Members
448,871
Latest member
hengshankouniuniu

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