To get an condition for excel mentioned in the attachment - excel

Please follow the attachment and let me know how can i get true, false and NA condition for the excel sheet
Column A --> It has repeated set of ID's (A,B,C)
Column B --> Data 1 to be compared with Data 2. And if the data2 is anywhere present in Data 1 and both share the same data from column ReportID, I should get true...otherwise false...and if data2 is blank then NA

Just use COUNTIFS:
Formula in column D:
=IF(C2="";"NA";COUNTIFS($A$2:$A$11;A2;$B$2:$B$11;C2)>0)

Related

match two columns in seperate sheets and add other two columns

I have 2 excel spreadsheets in a single excel file. Both of these files have a Campaign Name column and sum_revenues column
My first problem is that I want to match the Campaign Name column in both the sheets and if they match then I want to add the sum_revenues value in the 1st spreadsheet to sum_revenues in the 2nd spreadsheet
I know that sumif or sumifs will be used but I do not know how I can apply them.
The output should be the addition of sum_revenues column in both the sheets based on the Campaign name matching criteria in the sum_final column which is present on the 2nd sheet.
I hope I am clear about the question but please let me know if there is any confusion.
Below is how sheet 1, Sheet 2 looks like.
Sheet 1:
Campaign Name sum_revenues
ABC 40
DEF 60
Sheet 2:
Campaign Name sum_revenues sum_final
ABC 30 70
GHI 10 0
Now please note that in Sheet 2 in which I want to output is that sum_final column has the sum_revenues added up from both the sheets because ABC is present in both the sheets and it should show 0 for those which do not match.
Try:
=IFERROR(VLOOKUP(A2,Sheet1!$A$2:$B$3,2,FALSE),0)+B2
Sheet 2 Images:
Below formula may help you, assuming that your sheet1 data available in column A & B and sheet 2 data available in Column D & E and finally F would be the result.
Type the formula
sumif(e:e,d:d,a:a)+sumif(a:a,d:d,b:b) +e3

Excel Conditional Statement to determine which rows to delete and which to keep

I have 2 excel sheets containing data that will help me determine whether or not I need to delete or keep a row. Essentially, the way it works is that I have Column A in both sheets of the data which contains a code and column B of sheet 2 contains either a value of the text "Free". For each code in column A of sheet 1, I want to check if the same code exists in column A of sheet 2, and if so, I want to then look at column B of sheet 2 on that same row, and if it's cell contains "FREE" I would like to delete the entire row in containing that code from sheet 1.
Sheet 1: Sheet 2:
A B C A B C
1234 Data Data 1234 FREE Data
1235 Data Data 1456 Value Data
1547 Data Data 1547 Free Data
1483 Data Data 1247 Value Data
Then we Would get:
Sheet 1: Sheet 2:
A B C *Decision A B C
1234 Data Data Delete 1234 FREE Data
1235 Data Data Keep 1456 Value Data
1547 Data Data Delete 1547 Free Data
1483 Data Data Keep 1247 Value Data
This is what I have tried, but there is an error here I can't figure out. I am assuming I am doing something wrong with the syntax. HS is the name range of column A of sheet 2
=IF((VLOOKUP(A2,HS,1) = A2) and (Vlookup(A2, HS, 2) = "FREE"), "delete", "keep")
Try with below formula. It will work
=IF(ISNA(MATCH(A1,Sheet2!A:A,0))=FALSE,"Delete","Keep")
Proof of Work
EDIT #1
As per the request, please see the sheet 2 formula
=IF(ISNA(MATCH(A1,Sheet1!A:A,0))=FALSE,"Delete","Keep")
Your AND is in the wrong place. It should start the multiple conditions and each condition needs to be separated by a comma:
=IF(AND((VLOOKUP(A2,HS,1) = A2),(Vlookup(A2, HS, 2) = "FREE")), "delete", "keep")
Does this accomplish what you are looking for?
=IFERROR(IF(VLOOKUP(A3;Sheet2!$A$1:$C$5;2;FALSE)="Free";"delete";"keep");"keep")

Compare 2 sheets in 2 csv and replace value from one to the other

I'm trying to compare two sheets in excel and if matching "A" value then copy the value in the "B" to the other "I".
Ex:
Compare
Sheet 1 column A to Sheet 2 column A, if the Alpha numbers match then copy the value in Sheet 1 colum B into Sheet 2 colum I.
I have reference number in both A in need to replace the old image url by the new image url.
I have over 15 000 items and I will have to do this everyday so any automation would be great.
I have 2 csv files.
Any help would be appreciated
Thanks!
In Sheet2 column I using formular:
=IF(A1=Sheet1!A1,Sheet1!B1,"Value_if_not_match")
Hope this can help

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.

Excel vlookup with two columns in source and target returning another column

I have a spreadsheet that has 4 columns sheet 1, and 5 columns sheet2 and I need to do a vlookup on Sheet1!a2&c2 and match the row in sheet2!a2&c2 and return sheet2!c5.
I think Index and Match would do it but all the examples have been matching a single value to an array which isn't what I need for eg.
Can't do attachments yet :( text it is sorry for the format
Sheet1
R1 A B C D
R2 2 D 3 Result will match sheet1!a2&c2 to sheet 2!A3&C3 and return Sheet2!e3 ie 34
Sheet2
R1 A B C D E
R2 2 F 5 GR 72
R3 2 X 3 FR 34
Any links or help?
Update
Sorry I wasn't clear I want to match the cobination of A2 and C2 in sheet 1,
ie in the example =sheet1!A2&sheet1!c2=23
to the values in sheet2!a2 plus sheet2!c2,
ie in this example =Sheet2!a3&Sheet2!c3=23,
and then return the value in Sheet2!E? , ie Sheet2!E3=34 here
I've done this before by creating a cheat column in sheet 2 = a2&c2 in say d2 and filling down then using, assuming 3 rows, however I can't create the cheat column in sheet2
=vlookup(a2&c2,sheet2!d2:e3, 2, false)
The rows sheet2! look like, sorry about the formatting
Picture attached, which I suddenly got to do , where I need to match the yellow columns in the lookup then return the brown column to sheet1!E2 but I can't add the cheat column Sheet2!d2:3 to the sheet cause the user is difficult :)
Thanks again. Any good tutorial on Index?
Try using LOOKUP like this
=LOOKUP(2,1/(A2=Sheet2!A$2:A$10)/(C2=Sheet2!C$2:C$10),Sheet2!E$2:E$10)
The two "tests", i.e.
(A2=Sheet2!A$2:A$10)
and
(C2=Sheet2!C$2:C$10)
return "arrays" of TRUE/FALSE values but when you divide 1 by one of those and then the other TRUE is converted to 1 and FALSE to 0 so you get a resulting array of either 1s (where both conditions are TRUE) or errors [#DIV/0!] where one or both are FALSE.
When you lookup 2 in that array it will never be found so it matches with the last 1, i.e. the match is with the last row where both conditions are satisfied...and the corresponding value from Sheet2!E$2:E$10 is returned. Another way is like this:
=INDEX(Sheet2!E$2:E$10,MATCH(1,(A2=Sheet2!A$2:A$10)*(C2=Sheet2!C$2:C$10),0))
which requires "array entry" with CTRL+SHIFT+ENTER

Resources