Identify similar entries based on two criteria - excel

I'm trying identify different status of a product for same colour by using the below formula
=IF(B6&J6=B5&J5,IF(OR(B6&J6&L6=B5&J5&L5,B6&J6&L6=B7&J7&L7),"True","False"),"True")
Result
Expected Result
However, unable to achieve the expected result. I completely lost here kindly lend me a hand :)

Here is a possible answer. Count how many times the most common status (Seasonal) occurs for the current product and colour, then count how many times the status in the current row occurs. If the counts are the same, then this is the most common status so set the result to TRUE, otherwise FALSE.
=COUNTIFS($A$2:$A$20,A2,$B$2:$B$20,B2,$C$2:$C$20,C2)=MAX(COUNTIFS($A$2:$A$20,A2,$B$2:$B$20,B2,$C$2:$C$20,$C$2:$C$20))
Must be entered as an array formula using CtrlShiftEnter
or you can try
=COUNTIFS($A$2:$A$20,A2,$B$2:$B$20,B2,$C$2:$C$20,C2)=AGGREGATE(14,0,COUNTIFS($A$2:$A$20,A2,$B$2:$B$20,B2,$C$2:$C$20,$C$2:$C$20),1)
entered as a normal formula.
Here is a screen shot using your specified columns

Related

How to count similar groups of elements in Excel using multiple criteria?

I am trying to count groupings of elements in a list, in Excel, with groupings defined by 2 conditions: same Element and same Group code, as shown in the image below. The column C formula seems to throw errors as shown in orange highlighting in cells C9-C11. The formula for column C is displayed starting in column D. My expected grouping count is shown in column L with explanation starting in column M. Cells L9-L12 show what I expect the element count to be for Element X/Group 0.
Is there a correct formula for counting multiple-criteria groupings in Excel 365? I have tried various iterations of countifs() and sumproduct (See column D of the screencap) with no luck yet.
Post possible solution:
Now showing a scenario where the solution doesn't hold up (holds up in all other 16 scenarios I ran but not this one ???), see the orange cells with strange output versus expected output in yellow:
OK well in the first iteration of your question what seemed like a long time ago we all assumed that you wanted to count the total number of unique groups you have got so far. Now it's looking a bit different - the example implies that if both the element and group are repeated later on you want to revert back to the count of that element and group only and not the total count. I think what you want is a match like this:
=MATCH(A4&B4,SORT(UNIQUE(FILTER(A$4:A4&B$4:B4,A$4:A4<>""))),0)-
MATCH(A4&"*",SORT(UNIQUE(FILTER(A$4:A4&B$4:B4,A$4:A4<>""))),0)+1
Could be simplified using Let but it's late here and it's tentative anyway.
However the sorting assumes that the group keeps on increasing within each element and that wasn't the case in the first iteration of your question. You could try Sortby just sorting on the Element but that will have to wait till tomorrow.
EDIT
Here is my revised formula - plz try it.
=LET(range,A4:B$4,
unique,UNIQUE(range),
uniqueElement,INDEX(unique,0,1),
sortby,SORTBY(unique,uniqueElement,1),
sortElement,INDEX(sortby,0,1),
sortGroup,INDEX(sortby,0,2),
MATCH(1,(sortElement=A4)*(sortGroup=B4),0)
-MATCH(A4,sortElement,0)+1)
You could also use Take instead of Index. I've removed the filter for clarity because there aren't any blanks in the test data.

A cell containing the INDEX function is returning the incorrect values

I have the following formula within a cell:
=D26-($L26*$F$3*$E$4)+INDEX($A$1:$Z$500,ROW(D27)-$S$3,18)
It is returning 0, HOWEVER this is not the expected result. When I check the values of the individual terms by copy/pasting them separately into different cells here's what I get:
=D26-($L26*$F$3*$E$4)
returns 300, which is the expected value, and
=INDEX($A$1:$Z$500,ROW(D27)-$S$3,18)
returns 0, which is the expected value.
Why on earth does adding these two terms not return 300 as expected?
As some background, this is an inventory model that adjusts daily inventory based on yesterday's sales and any inventory that has arrived. The first two terms, D26-($L26*$F$3*$E$4), subtract yesterday's sales. The last term, INDEX($A$1:$Z$500,ROW(D27)-$S$3,18), looks back a certain number of days from the current row in order to add any inventory that is scheduled to arrive today. In this case, $S$3 defines lookback period (i.e. the delay between ordering inventory and receiving it).
Ideally, I want to just fill down =D26-($L26*$F$3*$E$4)+INDEX($A$1:$Z$500,ROW(D26)-$S$3,18) for the entire year (365 rows). However, the formula typically works for the first row, but then breaks when I try to fill down. It's not an issue with non-referenced cells. I've tested the individual terms for cells many rows down and they return the expected values. It's just when combining the terms or filling down, I can't seem to get the desired result.
Any guidance would be much appreciated.
I turned out that the cells referenced by the INDEX function contained the INDIRECT function. Eliminating the INDIRECT function got rid of the problem, and I'm getting the values expected now.

Why is it not returning the values of INDEX formula?

I'm using Excel 2016 and I'm finding for unique data from an array using INDEX, MATCH, and COUNT formula as follows;
{=INDEX(list,MATCH(0,COUNTIF(uniquelist,list),0))}
list = table[column_name] and uniquelist = $columnRow($B2:B2). I tried putting hard values and the results are the same.
My logic is simple; count the list with initial empty cell. That returns {0,0,..} array which gives MATCH(0,{0,0,..},0). That gives first index of matched value. So, I got INDEX(list,1) and it should return the first item, not 0.
I have tried searching on the Internet, and some people use new formula UNIQUE which is available only for Office365. I am getting 0 only and when I try to evaluate my formula, it shows the correct result until the last step.
My formula
Am I using the wrong formula? I don't want to simply copy&paste with "Remove Duplicates" feature built-in Excel.
https://support.microsoft.com/en-us/office/remove-or-allow-a-circular-reference-8540bd0f-6e97-4483-bcf7-1b49cd50d123#:~:text=If%20this%20confuses%20you%2C%20imagine,the%20formula%20in%20the%20cell.
Turn on Iterative Calculation
I HATE it when the application prevents the client's work with just a warning just because it may has impact on performance. Of course, my bad for not reading carefully every time a warning dialog box appears.

Find conditional MAX of only visible cells in Excel

I'm trying to find the highest score individuals achieved on a test, given that they failed the test, and I want to be able to use filters to narrow down to certain groups of individuals, which I've tried using the SUBTOTAL function to achieve.
Here's what I've tried so far:
SUMPRODUCT(SUBTOTAL(104,OFFSET(INDEX(TOTAL,1),ROW(TOTAL)-ROW(INDEX(TOTAL,1)),0,1)),--(PASS_FAIL="FAIL"))
'TOTAL' and 'PASS_FAIL' are named ranges for the individual's score on the test and whether they passed or failed it, respectively.
I realized that by using SUMPRODUCT this just takes all of the scores of those that failed the test and adds them together. And I can't find anyway to get anything else to work either.
Any help would be greatly appreciated!
wrap in MAX instead of SUMPRODUCT and multiply the two conditionals:
=MAX(SUBTOTAL(104,OFFSET(C2,ROW(C2:C16)-MIN(ROW(C2:C16)),0,1,1))*(B2:B16="A"))
Depending on one's version this may need to be confirmed with Ctrl-Shift-Enter instead of Enter.

Countif criteria and range are time values, excel 2016

I am using Excel for Mac 2016.
I would like to count number of occurrences of time values e.g., 5:00pm in a column (A1:A100000). I would like to count the number of occurrences according to time value criteria in a different smaller column e.g., (B1:B10), which are also times. So I am matching time with time. For each row of the smaller column, I have tried the following:
=COUNTIF(A1:A100000,B1), which returns 0.
=COUNTIF(A1:A100000,"="&B1), which returns 0.
=COUNTIF(A1:A100000,">="&B1), which funnily enough, returns an actual number of occurrences, but is incorrect because I only want it to equal (B3), not be greater than.
Even when I hard code it in:
=COUNTIF(A1:A100000,">=5:00") works, =COUNTIF(A1:A100000,"=5:00") does not.
Because the time values in (B1:B10) are in serial form, e.g., 5:00pm, 6:00pm etc, even when I try:
=COUNTIFS(A1:A100000,">="&B1,A1:A100000,"<"&B2), it doesn't seem to return a correct value.
It does not seem to matter whether I have the range and/or formatted as Time, or General, nothing works! I'm sure it must be something simple that I am missing.
ok, so here is the ACTUAL formula, which looks nothing like the simplified one above. Basic COUNTIFS with Named ranges, and criteria. I have also uploaded a link to a screen shot of formula, and sample file.
=COUNTIFS(Appointment_date,">="&$C$5,Appointment_date,"<="&$C$6,Client_Name,"?*",Status,"Attended; ",Location,"*Richmond",Appointment_Day,C$9,Appointment_time,$B12)/$C$7
Screen shot:
https://drive.google.com/file/d/0B_m00iNatJANMWVuWGdLem5Vb1U/view?usp=sharing
Sample of file:
https://drive.google.com/open?id=0B_m00iNatJANMnE0UXZyUTctYk0
The real problem appears to be in the formula's inability to recognise specific times in the "Appointment time" column. I have outlined specifics within the document.
Thanks so much!

Resources