Returning a result ONLY for unique criteria, with multiple criteria. OFFSET(), FREQUENCY(), SUMIF() - excel

Here is an overview of what I am trying to do.
i have 6 columns
A is alphanumerical
B is text
C,D are binary data
E is text
F is the column I want to populate with binary data
To simplify I would like to test columns B,C,D,E against a set of criteria (each column has its own set of criteria to test against). If all B,C,D, and E are "true" I want to return a "1" in column F.
Now here comes the problem I'm having.
Basically A is an ID#, and B,C,D,E are criteria each must met to return a "1" in column F. The problem is that there are multiple rows of each ID#. It doesn't matter which ID# instance, but I only want to return ONE "1" in column F for each unique ID#.
Once a 1 is returned for a particular ID#, I don't need it to actually check the remainder of the same ID# rows, it can move on to the next ID# if need be.
I'm returning a "1" for the simplicity of the question, but eventually I want to have multiple criteria sets, and return a letter corresponding to each set instead of a "1".
Ex/
Row 1 A="1D45", B=true, C=false, D=true, E=true -- Returns F="0"
Row 2 A="1D45", B=true, C=false, D=true, E=false -- Returns F="0"
Row 3 A="1D45", B=true, C=true, D=true, E=true -- Returns F="1"
Row 4 A="1D45", B=true, C=true, D=true, E=true -- Returns F="1", BUT i want it to show 0
Row 5 A="1D45", B=true, C=false, D=true, E=false -- Returns F="0"
Row 6 A="1D45", B=true, C=true, D=true, E=true -- Returns F="1", BUT i want it to show 0
Row 7 A="1D46", B=true, C=true, D=true, E=true -- Returns F="1"
etc. etc.
Thanks a bunch

Your formulas are:
F1:
=--AND(B1,C1,D1,E1)
F2:
=AND(B2,C2,D2,E2)*(0=COUNTIFS(A$1:A1,A2,F$1:F1,1))
Fill down column F from F2.
In the first AND, you can replace B2 and C2 etc with your actual conditions. The last condition is actually what checks that this ID in column A has not yet got a value of 1 in column F above it.

Related

Searching a column for a string in one array, and returning a value that corresponds to that array

I am going to do my best to describe this.
I want to search column C for any of the strings contained on a different sheet in column A, and if/when one of those strings is found, i want to return the column B that corresponds to the found string.
For example:
Sheet 1:
Column A
Column B
Column C
project 1
2/15/19
Status is Red, because....
Project 2
4/12/20
RAG- Green, PTG is....
And on another sheet I have common ways to describe their statuses in Column A, and in Column B, a simple letter R, A, G or NS (Not started) if no other common status is found.
Column A
Column B
Column C
Status is Red
R
Rag- Green
G
How can I Search Column C for a value on Column A (on a different sheet) and return column B in Column D on the original sheet?
Results should look like
Column A
Column B
Column C
Column D
project 1
2/15/19
Status is Red, because....
R
Project 2
4/12/20
RAG- Green, PTG is....
G
This may be a bit of an extended function and depends on how many rows you have in the second sheet.
You can hard code it with
=IF(ISNUMBER(SEARCH("Red",C2)),VLOOKUP("Status is Red",Sheet2!$A$2:$B$3,2,FALSE),IF(ISNUMBER(SEARCH("Green",C2)),VLOOKUP("RAG - Green",Sheet2!$A$2:$B$3,2,FALSE),"NS"))
Or use the more dynamic:
=IF(ISNUMBER(SEARCH(Sheet2!$A$2,Sheet1!C2)),VLOOKUP(Sheet2!$A$2,Sheet2!A2:B3,2,FALSE),IF(ISNUMBER(SEARCH(Sheet2!$A$3,Sheet1!C2)),VLOOKUP(Sheet2!$A$3,Sheet2!$A$2:$B$3,2,FALSE),"NS"))
Explanation
SEARCH(find_text,within_text) - returns the index of where the substring begins
ISNUMBER(value) - returns TRUE if a number, FALSE if not.
VLOOKUP(lookup_value,table_array,col_index_num,[range_lookup]) - finds the value within the array and returns the corresponding value in the specified column.
$X$Y - the dollar signs stop the values from changing when you use ctrl+d or ctrl+r to fill multiple cells
So to break it down:
IF (search returns an index)
THEN VLOOKUP (find this value and return the corresponding value from this column)
ELSE (repeat above as needed)
ELSE ("NS")

Auto Increment the value of a cell based on an adjacent sell value plus search last number increment by 1

Ok I have 2 excel columns
1st column A "Workstream", is a data list with three numbers as a dropdown. 1,2,3
2nd column B "ID", would like to auto-populate based on the selection made from the left adjacent cell + perform a lookup to get the MAX number in the current column and ADD by 1.
For Example:
Workstream
ID
1
W1-001
1
W1-002
1
W1-003
1
W1-004
2
W1-001
1
W1-005
2
W1-002
So when a user selects from the drop-down in column A then Column B auto-populates with something like this
="W"&A:1&"-"
However, in order to complete the value, it needs to do the following:
="W"&A:1&"-" Search for the Max Record in Column B that starts with 1 or whatever value was entered into Column A, then include the next number based on the MAX value selected in Column A
So in the above example, let's say I Enter "2" in column A, then the value that auto-populates in column B would be
| 2 | W2-003
or if I selected 1 from column A given where we left off then the value that would auto-populate in column B would be:
| 1 | W1-006
If I am understanding correctly and you want the format to be "W" followed by number of the workstream (as inferred from the text of your question) try:
="W"&A2&"-"&TEXT(COUNTIF(A$2:A2, B2), "000")
If instead you want the output exactly as shown in the picture you provided, it's even easier:
="W1-"&TEXT(COUNTIF(A$2:A2, B2), "000")
EDIT: You might consider pre-dragging the formula to all the rows that you think have the possibility of being impacted so that you don't have to drag the formula each time you add a row. In that case, try:
=IF(A2="","", "W"&A2&"-"&TEXT(COUNTIF(A$2:A2, B2), "000"))

Keep on summing corresponding cell and compare with first column for summing up first column based on comparision in excel

Consider the following data setup:
_A_ _B_ _C_
1 1
2 1 1
3 3
Such that a formula would return the following results for columns B and C respectively:
_A_ _B_ _C_
4 2
Now I want to sum column A if A-(B+C) is equal to 0.
so for above example sum would be 1+3 = 4 on column B, since row 1 and 3 satisfy 1-1=0 first row, 3-3=0 third row. so A value on 1st and 2nd row is 1+3=4. Row 2nd doesn't satisfy 2-1=1 not 0 so ignore.
on column C, B+C in second row 2-(1+1) = 0 ,So it would be sum 2 in that column C, ignoring first and third row since it already has been counted on column B.
columns continue like D E....
So sum up from B to current column..so if i am in column B it will sum up till B.If in C B+C....If in D B+C+D etc and then compare with column A
Insufficient rep to comment, this is at least a partial answer and perhaps full.
I think you're looking for this to happen in some lower row in B:
=SUMPRODUCT(--(A1:A3=B1:B3),A1:A3)
And this in C:
=SUMPRODUCT(--(A1:A3-(B1:B3+C1:C3)=0),A1:A3)
Although as EEM points out all the sample rows satisfy this condition so you get "6" instead of "2"

VLOOKUP together with MATCH

I have the below lookup condition but can't seem to get it working.
=VLOOKUP(A1,'Raw Data'!A1:A3,MATCH('Submitted Data'!B1,'Submitted Data'!A1:B1))
I'm trying to pull in the B column value from Submitted Data into the B column in Raw Data based of a match on A columns, I just keep getting an error.
Raw Data
A B C
1 L1 23
2 L2 17
3 L7 31
Submitted Data
A B
1 L1 Complete
2 L7 Pending
3 L2 Complete
vlookup does the match for you so you don't need that function. This should work for you:
=VLOOKUP(A1, 'Submitted Data'!A1:B3,2,FALSE)
Where
A1 is the cell with the value you want to find in a different range of cells (i.e, the data on the other sheet.
Submitted Data'!A1:B3 is the range of cells containing the data you want to find your A1 in, and then return the value that's a defined number of columns away from it (see the next sentence).
2 is the column from the range Submitted Data'!A1:B3 (i.e. column B) that has the value you want to return.
FALSE means you want an exact match for your A1 value.

Compare two Excel columns, output cells in A that do not appear in B

I am trying to compare two columns in excel, A and B. Column A contains a complete list of customer numbers. Column B contains an incomplete list of the same customer numbers. So if a customer number is in A, but not in B then output that number to column C.
I'd use the MATCH function in combination with ISNA.
If I have the following table
A B C
1 4
2 3
3 1
4 7
5 2 5
6 6
7
I put in column 'A' the full customer list, and in column B is a random ordered partial list. I then put the function in C1 (and the rest of column C):
=IF(ISNA(MATCH(A1,B:B,0)),A1, "")
Now I see the values '5' and '6' only in column C, because those are the only two numbers that don't appear in column B.
In Cel C1 =IF(ISERROR(VLOOKUP(A1,$B$1:$B$10,1,FALSE)),A1,"")
Adjust for row counts and fill down against column A.
I think you're looking for something like this:
=IF(ISERROR(MATCH(A1,B1,0)),A1,"")
Propegate that formula along your new column and it'll reprint the populated Column A when Column B is a no match.
Reference URL: http://support.microsoft.com/kb/213367
(I believe I read the original question wrong, and am going on the assumption that column A and B are already sorted where the values will line up.)

Resources