I have two sheets with last names and addresses in Columns A-F. I've tried using multiple formulas to compare the data, but the closest I've gotten is one row will show 'TRUE' while all other rows show '#VALUE'. Also, I've tried using different row numbers; if I use A1 to A69 it will work when comparing only Column A, but if I use A70 or greater then I get the '#VALUE'. Can anyone please help?
I've used the following, and have tried variations of them:
=COUNTIF(Proper2!A:F,A8828:F8828)=6
=COUNTIF(Proper2!A:A,A8828)=1
=AND(EXACT(A2:A69,A16))
=AND(Proper2!A2:A69,A16))
=IF(ISNA(VLOOKUP(A2,Sheet2!A1:A10,1,0)),"no","yes")
I would like to have a column that showed either 'True/False' or 'Yes/No' for instance; Row18 A:E which matches Row3 G:K.
The simplest thing I could think of is,
1) Concatenate all columns for each row and store in some column (far away say AM,AN So that it doesnt disturb). Do this for both the tables, for all rows
=CONCATENATE(A2,B2,C2,D2,E2)
=CONCATENATE(G2,H2,I2,J2,K2)
2) Now compare AM and AN using countif and if. This will tell you if there is a match or not
=IF(COUNTIF($AN$2:$AN$7,AM2)>0, "Match", "No Match")
Related
I have a list of names in column A on two separate sheets. Then, in columns B, C, and D - I have a Y or N. I'm trying to check the difference between sheet 1 and sheet 2.
Formula Function:
Check for value in Sheet1!A1 in Sheet2!A:A
If Sheet1!A1 matches (for example) Sheet2!A4,
Then check Sheet1B1:D1 against Sheet2!B4:D4
Return Match or No Match.
If Sheet1!A1 doesn't match any value in Sheet2!A:A, Return N/A
I've tried a couple dozen different combinations of VLookups, INDEX MATCH with an IF and AND to get it to confirm all three values, but can't seem to figure out how to combine all 3.
The COUNTIFS function is what you're looking for. Based on your description, something like this should work for you:
=IF(COUNTIF(Sheet2!A:A,Sheet1!A1)=0,"N/A",IF(COUNTIFS(Sheet2!A:A,Sheet1!A1,Sheet2!B:B,Sheet1!B1,Sheet2!C:C,Sheet1!C1,Sheet2!D:D,Sheet1!D1)=0,"No Match","Match"))
)
Try this (at home I have only the Dutch version, but tried my best to translate it to English formulas):
=IF(ISNA(VLOOKUP($A1;Sheet2!$A:$D;1;0));"N/A";IF(AND(VLOOKUP($A1;Sheet2!$A:$D;1;0)=$A1;VLOOKUP($A1;Sheet2!$A:$D;2;0)=$B1;VLOOKUP($A1;Sheet2!$A:$D;3;0)=$C1;VLOOKUP($A1;Sheet2!$A:$D;4;0)=$D1);"Match";"No Match"))
NOTE: This means the data in rows B:D on Sheet1 are in the exact same order as on Sheet2. If not, it will result in a "No Match".
I am trying to lookup a table in one of my sheets. my table consists of three columns and an unlimited amount of rows.
My table can be seen here:
In my second sheet I wish to write a formula which searches all rows in the table and looks for an exact match in column A and column B, this means it must find the row where column a has a value of "jan" and in that same row the second column must have value "y". Should it find this match, it should return the value of column C.
I tried researching hlookup but that is for horizontal tables so i dont believe this would work. I looked into Vlookups also but that only allows one criteria search instead of looking for two matches.
Can anyone shed some light here please?
You can use index and match with multiple criteria
=INDEX($A$1:$C$1000, MATCH("Jan"&"y", $A$1:$A$1000&$B$1:$B$1000, 0),3)
press CTRL + SHIFT + ENTER when entering this formula.
Convert the range to a table (ctrl-t) and then use SUMIFS to search the table based on two criteria
=SUMIFS(Table1[Alteration],Table1[Month],"Jan",Table1[Products],"y")
This is saying "give me [Alteration] where [Month] = "Jan" and [Products] = 'y'...this returns 364.
You can point the criteria at separate cells containing your criteria.
Be aware that if there is more than one row with identical data (ie more than one row with both 'Jan' and 'y'), column C will be summed together.
The INDEX function has the syntax
INDEX(array, row_num_in_array, [column_num_in_array])
And MATCH returns in the index location of a logic match
MATCH(lookup_value, lookup_array, [match_type])
Combining the two is a flexible technique, and surprisingly powerful -- the logic in a match lookup_value can be a complex condition.
SIMPLEST CODE
Operate on the whole column
INDEX(C:C, MATCH("Jan"&"y", A:A&B:B, 0), 1)
nb./ A:A is excel code for "all of column A". You can instead use:
RESTRICTED CODE
Operates on a subset of the sheet.
INDEX($C$2:$C$1000, MATCH("Jan"&"y", $A$2:$A$1000&$B$2:$B$1000, 0), 1)
Note that you MUST use identical row length arrays (eg. rows 2:1000) or the formula will not work. MATCH only knows how many rows into its lookup_array it got, you need to ensure its rows match those in INDEX's array
PS. apologies this is close to the previous answer, but the details were too long for a comment.
PPS. I missed the clarifications to the first answer. That will work, but there is no need to use all three columns as the array in the INDEX function. You are only returning data from column C after all.
I am looking for returning multiple column values using multiple matching criteria.
Attached is a screenshot of sample sheet, which have my criteria on cell's B1 & C1.
So basically, when matching 2 criteria (example "Team1" & "low"), it should return columns header (example Name10 & name14) from the header ranger C3:N3.
I have tried a couple of formulas, and is is how far I gone: =INDEX($C$2:$AL$2,SMALL(IF(($A$3:$A$21=$B$1)*($B$3:$B$21=$C$1),ROW($A$3:$A$21)-ROW($A$3)+1),ROW(1:1)))
I am not sure what is missing?
enter image description here
enter image description here
Thanks in advance
Fox
First of all, in your example you point out row 3 and 4 but only one of the specified criteria are matched in this rows: low, because Team4 specifyed in the criteria it's not matched, so i will consider you are looking to match one OR both the criteria specified.
The only way i can imagine for do this with a formula is to use a formula like this
=SE(C3<>0;$C$2&", ";"")&SE(D3<>0;$D$2&", ";"")&SE(E3<>0;$E$2&", ";"")&SE(F3<>0;$F$2&", ";"")&SE(G3<>0;$G$2&", ";"")&SE(H3<>0;$H$2&", ";"")&SE(I3<>0;$I$2&", ";"")&SE(J3<>0;$J$2&", ";"") 'and so on...
where SE() it's function IF() in my language, with this formula in a column on the right of the table (for example col O) you will have a list of the names of that row where the corresponding number is different from 0...expand the formula down for all the rows and then, with a formula like this
=SE(O(A1=A3;B1=B3);O3;"")&SE(O(A1=A4;B1=B4);O4;"")&SE(O(A1=A5;B1=B5);O5;"")&SE(O(A1=A6;B1=B6);O6;"")&SE(O(A1=A7;B1=B7);O7;"") 'and so on...
with the function O() corresponding to OR() you will concatenate the strings (names) of the rows that match one OR both the criteria. If you whant to match both the criteria you should use AND() instead of OR().
The problem of this approach is that the formula becomes very long if you have a lot of names and a lot of rows, and if you add rows you have to modify the formula. Another problem is that if you match the same name more times it will be repeated in the list that the formula outputs...and the list of the names ends with a comma.
In fact, i can't tell that this is a good way for obtain what you need, but it's the only i can imagine only with formulas.
If you should use a macro the problem would be solved better and in a more flexible way, should you?
I've run into an issue with trying to sumifs across a range of columns. The way the data is structured, I have a range of countries (column B-H) and a row of associated numbers (column I-O). I'd like to sum the volumes with associated countries (ex: XX for Afghanistan) - however, there's a catch. I only want to sum across those columns if another criteria (denoted by "yes use this") appears in column FI. I'm having a hard time getting all of these pieces to work together -- any ideas??
Attempt 1:
=SUMIFS(I5:O1000,B5:H1000,"Afghanistan",FI5:FI1000,"yes use this")
Result : = #VALUE error
I'm assuming this is because the ranges don't match (B5:H1000 spans 7 columns, FI5:FI1000 spans 1).
Attempt 2:
=SUMIFS(I5:I1000,B5:B1000,"Afghanistan",FI5:FI1000,"Yes use this")
Result: the correct number
The above assumption was correct, but then this doesn't solve my problem. I don't want to have to copy and repeat the formula for each column.
Attempt 3:
=IF(FI5:FI1000="Yes use this", SUMIFS(I5:I1000,B5:B1000,"Afghanistan"),"FAILED")
Instead of pulling back the correct number, the formula spits out FAILED - which is incorrect.
Any thoughts are appreciated, thanks!
You can try:
=SUM(IF(B5:H1000="Afghanistan",IF(FI5:FI1000="yes use this",I5:O1000,0),0))
entered as an array formula (CTRL-ENTER)
I have a large Excel dump from SQL with many columns of data. Two of those columns have different fields with various text values. There are six correct values for the first column and five correct values for the second column. I need to count the accounts (column A) that have both "correct" values.
Well, I just stumbled on this guy:
=COUNTIFS(A:A,"val1",B:B,"val2")
where:
A:A is the first column you have.
"Val1" is the valid value in the first column you want.
B:B is the 2nd column you have.
"Val2" is the valid value in the 2nd column you want.
Unfortunately, that only works if you have 1 value for each column .. and they work more like an AND .. not an OR.
So rather than that, I'd suggest a "helper column":
1) setup your list of valid values somewhere else, and name the lists: "validcol1" and "validcol2"
==IF(OR(ISERROR(MATCH(A2,validcol1,0)),ISERROR(MATCH(B2,validcol2,0))), "", "Valid!")
I solved it through and array that uses "find."
{ =SUM(1*(IFERROR(FIND(b1:b413,"0B,D,E,K,L,S"),0)>0)*(IFERROR(FIND(c1:c413,"0ZA,ZB,ZC,ZF,ZK"),0)>1))}
Note the use of the leading 0 at the start of each set of values.
It's my understanding hard-coding the values into the formula isn't ideal. Anyone have any ideas for that?