microsoft excel counting word based on condition and matcting - excel

in column A there are some name like a,b,c,d (almost thousand) and in column B there are value either x/X or nothing.
now i want to count for name a how many x/X he has. note that may be user will use x or X(capital)
is it possible to use function. i tried this one SUM(IF(FREQUENCY(A1:A18,A1:A17)>0,(b1:b17=x or X )*1,0)) but not working. can any one guide me?

Sort the data see here and then apply SubTotals see here
EDIT
If you need to do it in code, the rudiments of the approach (using a different example can be found here.

Related

Return the value in the first non-empty cell in the column directly to the left and going upward

I'm all new to VBA and have mostly been trying to modify code after recording macros, so it's all pretty basic and the approach might not be as elegant as some of the stuff I've seen on here. So here we go.
I have coded (by brute force) my data to be arranged like a CAD design tree view with parent products/assemblies and constituent sub-assemblies/parts.
Column E contains Level 0 top assembly Part Number
Column F contains Level 1 items Part Number
... etc all the way to ...
Column M containing Level 8 items Part Number
As an example, cell G112 contains ASSY1; cells H113 to H134 contain its constituent items.
I would like to display in a new column (i.e. Column O) the value of cell G112 (ASSY1) for each of its constituents. So O113 to O134 would show the value of G112. That would need to be applied to every single level of the assembly.
I'm not sure I'm making much sense do please have a look at the picture linked below, it speaks a thousand words. I've highlighted and colour-coded the result I would like in column O.
ADDENDUM - To clarify things:
I don't know how else to explain my request but to post a simplified version of my original picture.
SIMPLIFIED EXCEL TABLE
.CSV available here WeTransfer
A very useful tool to retrieve VBA code for determined action is the macro recorder, in the ribbon, Developer -> RecordMacro, perform you action and stop recording and then you can check the code generated for the actions you recorded. Its not the cleanest code but you can find there the lines of code for the specific actions you want. Once you step into a one concrete problem with the code you tried, you can then ask for help regarding something more concrete, more than expecting that someone will code that for you.
Anyhow if you want someone to try to solve your problem, you need to post the table with the accessible data instead of the image, for the person whoever tries to approach your problem to have the data available.
Hope that helps
Here's the answer I got from somewhere else if anyone is interested:
Formula in Cell O3:
=IF(C3=0,"N/A , ALREADY TOP LEVEL",INDEX(D$2:D2,AGGREGATE(14,6,(ROW(D$2:D2)-ROW(D$2)+1)/(C$2:C2=C3-1),1)))
Copy/Paste down in every cell in column O

Define Status depending on Criteria

I have advanced Excel/Google Sheets skills. I have more of a conceptual question. I am happy with any solution (Excel or for Sheets, no difference for me).
I have a sheet where various coworkers have access and work with. It is used to define which product needs to go through which steps. Then when a part of a job is done, the status of the product is changed depending on criteria.
You can also think of it as projects and the status of a project.
The 3 examples shows how the data is input by the workers. Sometimes, the "No" cells are empty, sometimes they have a "No", sometimes for the same product, one criterion is empty, the other has a "No".
If I do a nested IF formula, I would have to create 32 of them (I believe, since its 5 criteria with each 2 options).
Obviously I can do that. I was wondering anyone has a better solution for me? Something more practical.
Thanks in advance!
Based on the data you've provided, it looks like your statuses are based on the number of Yes's in the input columns. Also you don't have a status shown for zero Yes's so I'll make an additional for that.
Given that assumption you can use a combination of the COUNTIF function (to count the Yes's), and the IFS function (to manage nested Ifs better) to drastically reduce the size of your function.
To make this cleaner I suggest you add a column and hide it containing: =COUNTIF([InputCriteria1to5Range],"Yes")
For the next formula assume the formula above is in B2. In your status column put the following:
=IFS(B2=5, Status1, B2=4, Status2, B2=3, Status3, B2=2, Status4, B2=1, Status5, B2=0, Status6)
Solution: Thanks to all for your help, I ended up firstly, creating ALL scenarios. This was actually the most complex part. See https://www.mrexcel.com/forum/excel-questions/654871-how-generate-all-possible-combinations-two-lists-without-macro.html (Answer from "Tusharm") where I had to repeat this process 5 times to have all possible outcomes. In the end, there were 192 combinations.
Then, I assigned a status for each combination.
Finally, for each product/row, I created another column where I concatenated the different criteria so that it looks exactly like my above combinations. Then finally index match the concatenated criteria to my combinations.

Nested IF statements with VLOOKUPs

I'm trying to created a nested IF statement that says, for example, IF A2 is equal to x, x, x posting codes then pull data from the revenue column, IF A2 is equal to y, y, y posting codes then pull data from Bad Debt column and so on for 6 different possible results. Only 3 of the 6 are VLOOKUPs. The other 3 are just if A2=Z then "1024".
I will copy what code I currently have, but it's not pretty. Any help is appreciated. Thank you.
=IF(G2="100",G2="101",G2="102",G2="105",G2="106",G2="170",G2="171",G2="173",G2="200",G2="210",G2="220",G2="230",G2="250",G2="300",G2="301",G2="302",G2="304",G2="305",G2="306",G2="307",G2="308",G2="309",G2="310",G2="312",G2="313",G2="314",G2="315",G2="316",G2="317",G2="318",G2="319",G2="320",G2="321",G2="322",G2="323",G2="324",G2="325",G2="326",G2="327",G2="328",G2="329",G2="330",G2="331",G2="332",G2="333",G2="334",G2="335",G2="336",G2="337",G2="338",G2="339",G2="340",G2="341",G2="342",G2="343",G2="344",G2="345",G2="346",G2="360",G2="370",G2="372",G2="379",G2="382",G2="383",G2="385",G2="390",G2="402",G2="403",G2="404",G2="405",G2="414",G2="415",G2="416",G2="417",G2="418",G2="419",G2="420",G2="421",G2="425",G2="427",G2="428",G2="429",G2="440",G2="441",G2="442",G2="443",G2="444",G2="445",G2="447",G2="472",G2="477",G2="480",G2="501",G2="600",G2="700",G2="800",G2="900",vlookup('AR Credit'!A2,Guarantors!A:D,3,FALSE),IF(G2="347",G2="384",G2="399",G2="406",G2="499",G2="801",vlookup('AR Credit'!A2,Guarantors!A:D,5,FALSE),IF(G2="348",G2="354",G2="355",G2="357",G2="377",G2="601",vlookup('AR Credit'!A2,Guarantors!A:D,4,FALSE),IF(G2="120",G2="150",G2="151",G2="152",G2="153",G2="154","1051",IF(G2="400","1385",IF(G2="500","2036",IF(G2="172","3783","Null"))))))))
One way of fixing your issue is by using OR, specifically wrapping your cases in it like in this example:
=OR(G2="100",G2="101",G2="102",G2="105")
This will result in TRUE if any of conditions is met, otherwise FALSE.
There are numerous errors with your formula. You could get it working by following Zipa's answer and using the OR function. However, it would be a nightmare to maintain if anything changes in future.
I would recommend creating a look up table for the values and results. It could then be queried like so:
=IF(COUNTIFS($E$2:$E$98,$A2)>0,$E$1,
IF(COUNTIFS($F$2:$F$98,$A2)>0,$F$1,
IF(COUNTIFS($G$2:$G$98,$A2)>0,$G$1,
IF(COUNTIFS($H$2:$H$98,$A2)>0,$H$1,
IF(COUNTIFS($I$2:$I$98,$A2)>0,$I$1,
IF(COUNTIFS($J$2:$J$98,$A2)>0,$J$1,
IF(COUNTIFS($K$2:$K$98,$A2)>0,$K$1,"NULL")
)
)
)
)
)
)
See the image below for illustration:
Where I have put "Opt1", "Opt2" in the results row, you can put your VLOOKUPs (although I would recommend INDEX/MATCH instead) or your hard coded values.
This way, you can easily see (and modify) which group each code is in. Even adding more groups wouldn't be too difficult.
Obviously, you could move the table onto a different sheet if you wished.

Google Drive(Excel): Using Sumif for each unique string value without making a separate sumif command for each

Okay, Looked for about 30 minutes before I realized that I don't have the necessary knowledge to know the proper terms to use for this question... please help... If it matters, I'm using google docs, which as best as I can tell is ALMOST always compatible with Excel.
I have a spreadsheet that has two columns that I care about, Column B contains names, and Column T contains numeric values that I need to add together depending on the name in Column B.
="Reon: " & SUMIF('Form Responses'!B2:B10000,"Reon",'Form Responses'!T2:T10000)
I could make a few hundred sumif commands like the above, and add new ones every time a new name submits the form for the first time, but this is manual and would take forever. Is there a way to get the unique values of Column B, and put them into this formula to make a list resembling:
Name1: 247, Name2: 698, Name3: 420
The Exact formatting does not really matter as long as the name is displayed with the number and not a long string of indecipherable numbers. The generated list will be read by a real live person.
Thanks for any and all help you can provide.
Pnuts, Thank you for your wonderful links!
Here's the Code I used to manage it based on them.
Column One
=UNIQUE('Form Responses'!B2:B1000)
Column Two
=SUMIF('Form Responses'!B2:B100,UNIQUE('Form Responses'!B2:B100),'Form Responses'!T2:T100)
This gave me two columns with corresponding numbers and names in each. Thanks so much!

How to search for a partial and an absolute in excel to get an answer?

I have a worksheet, in where I need a search that does more than one query. The problem I am running into is this:
On the workbook there are two tabs, the first is Jobs, the second is OOR. In OOR there are multiple columns empty, Order Qty., Orig Promise Date, and Shop Order.
Now I know there are duplicates, and this is fine, what I am looking at now is to use Column B in OOR is a refrence. So in this case use B3 as the refrence point. which is a partial number of 48900421 Rev 2. What I want to do is this, use two refrence points.
I want to look up B3 in OOR, and use two points of refrence to gurantee the correct job is refrenced. Those two columns to refrence is in Jobs. The first is Column B which will always equal Dakota Systems, Inc., and the other will reference Column C, but this is where I don't know what to do here, I since C3 in OOR only shows 48900421, it will never find 48900421 Rev 2I thought about using something like this:
=IFERROR(INDEX(Jobs!$E:$E,MATCH(1,INDEX((OOR!$C:$C=$B3)*(Jobs!$C:$C="Dakota Systems, Inc."),1),0)),"")
But for some reason I am getting a blank when I don't think I should be. I'm loosing my sanity this late in the week, can someone help?
https://dl.dropbox.com/u/3327208/Excel/twosearches.xlsx
You don't seem to be referencing the right columns....and also you need a zero in the second INDEX function, not a 1
Try this version in in OOR!I3 copied down, using ISNUMBER(FIND to find your part number within other text:
=IFERROR(INDEX(Jobs!E$3:E$1000,MATCH(1,INDEX(ISNUMBER(FIND(B3,Jobs!C$3:C$1000))*(Jobs!B$3:B$1000="Dakota Systems, Inc."),0),0)),"")
format in required date format
Revised re comment below:
=IFERROR(INDEX(Jobs!E$3:E$1000,MATCH(1,INDEX(ISNUMBER(FIND(B3,Jobs!C$3:C$1000))*(Jobs!B$3:B$1000="Dakota Systems, Inc.")*(Jobs!A$3:A$1000=M3),0),0)),"")

Resources