Referencing current cell for compare across sheets - excel

I'm trying to compare binary values between two sheets in Excel. Here's a quick snapshot of what the data might look like for row 1, columns A-D on the two sheets.
A B C D
1 1 1 1 1 <--- Sheet 1
A B C D
1 1 1 0 0 <--- Sheet 2
What I would like to do is Conditionally Format sheet 2. I'm only concerned about the cells where the values are not the same, so in the example above cells C1 and D1 on Sheet 2 do not match the values on Sheet 1, so I want to either change the font or background. At this point I don't care. If I were just comparing these 4 cells I could do this easily enough. But I've actually got 160 rows and about 1000 columns of binary data, so I don't want to condition each cell individually. What I can't figure out is how to conditionally format the entire sheet using a formula that references the current cell vs the current cell on the other sheet.

For excel 2010:
Select the area on sheet 2 you want to compare
Select conditional formatting under the "home" ribbon, then "new rule"
Select "use a formula to determine which cells to format"
Type the following, but replace "A1" with the top left cell in your selection range, and replace the sheet names with your sheet names
=IF(Sheet1!A1=Sheet2!A1,FALSE,TRUE)
Select your desired format
Hit "OK" on both dialogs

In general, you could use a comparison utility like BeyondCompare. Ensure each sheet is saved into its own file, then throw them at the utility.

Related

excel/google sheet - combining 2 column into 1 (vertically)

what is the formula to combine 2 column into 1?
(sheet link included : here)
for example :
Column A
Column B
Cell 1
Cell 2
Cell 3
Cell 4
Cell 5
Cell 6
become :
Combined
(with the spacing blanks included)
Cell 1
Cell 3
Cell 4
Cell 6
Cell 2
Cell 5
this is the database primary sheet, so the plan is i will load/link from this database sheet to another sheet (plus in case i have another cell to add between, it will sorted out automatically)
i try arrayformula({A:A;B:B}) but it tells me to add another row ?
help please
formula tried :
arrayformula,
flatten,
(it tells me to add another row?)
unique
(it overwrite the doubles? and remove blank space?, i need the text to be it as it is)
Try the following formula for raw materials. Then use same formula for packaging and change column references.
={FILTER(A:A,A:A<>"");" ";FILTER(E:E,E:E<>"")}
Edit: To include blank cells try this formula-
={C1:INDEX(C1:C,MATCH("zzz",C1:C));" "; G1:INDEX(G1:G,MATCH("zzz",G1:G))}

Using VLOOKUP to match 2 cells sheet2 to sheet1 and return the 3rd cell

I have been using VLOOKUP() to populate worksheets with Inventories, however I'm stuck with an issue where one column has the same value in multiple cells, I need to match 2 cells from sheet 2 with sheet 1 and have it return the 3rd cell from sheet 1 into sheet 2.
I'm working with about 350 rows in both sheets, and in some cells the same/different values repeat it self hence needing it to match with 2 cells in the same row.
This is the formula I currently use:
=VLOOKUP(A1&L1,'Sheet1'!$A$1:$E$351,3,FALSE)
I'm expecting it to return the value that's in the 3rd column on sheet 1 in the row that matched the values of Cell A1 and L1 in sheet 2. and the same going on A2 & L2 then A3 & L3 and so forth.
Unless you have values in Column A of your 'Sheet1' that are the equal to to concatenation of your values in Columns A and L in 'Sheet2', the formula will not work.
Instead, I'd try FILTER if you have the newest version of Excel. Something like:
=FILTER('Sheet1'!$C$1:$C$351,
(('Sheet1'!$A$1:$A$351=A1)*('Sheet1'!$L$1:$L$351=L1)))
Another option is INDEX. Something like:
=INDEX('Sheet1'!$C$1:$C$351,
MATCH(A1&L1, 'Sheet1'!$A$1:$A$351&'Sheet1'!$L$1:$L$351,0),
3)
The only way to do this task is to use a helper column
Go to Sheet one where the data table is, insert a column at the starting point of data e.g your Data set starting in SHEET1 from the column A. so insert new column in A
use this formula in A1
=CONCATENATE(B1,C1,D1,E1,F1) Press Enter, Drag the formula down to A351
now go to sheet2 and use this formula in the result cell
=VLOOKUP(A1&L1,'Sheet1'!$A$1:$F$351,4,0)

Extract only rows that are not in both sheets into a third sheet

I have 2 excel sheets with similar column values (legal_id). Is there a way to extract only rows that are not in both sheets into a third sheet? For example if social security number 111111 isn't in both sheets, then that persons row would be placed in the third sheet..please see images below.
Sheet 1
Sheet 2
Sheet3_DesiredResults
Before I get backlash about not attempting code this is what I tried,
I thought this formula would highlight true or false to values that are not in the same sheet, then I could just delete every field that returned true to be in both sheets , but it doesn't work. I'm not a programmer, I need help. Please don't tell me to take a VBA tutorial.Instead of making a third sheet , I made a helper column on the first sheet and used the formula:
=(ISNA(MATCH(A2,Sheet1!A:A,0)))=FALSE
Like anticipated in my comment, you might use 2 ranges in the third sheet and the COUNT.IF function. The formulas you need are these:
=IF(COUNTIF(Sheet2!$A:$A,Sheet1!$A2)=0,Sheet1!A2,0)
.
=IF(COUNTIF(Sheet1!$A:$A,Sheet2!$A2)=0,Sheet2!A2,0)
Place them in 2 proper cell in the third sheet (let's say A2 and E2), drag them to cover the two lists. Empty cells or cells with IDs in both Sheet1 and Sheet2 will return 0. If you don't like 0 and you prefear "", you might use these:
=IF(IF(COUNTIF(Sheet2!$A:$A,Sheet1!$A2)=0,Sheet1!A2,0)=0,"",IF(COUNTIF(Sheet2!$A:$A,Sheet1!$A2)=0,Sheet1!A2,0))
.
=IF(IF(COUNTIF(Sheet1!$A:$A,Sheet2!$A2)=0,Sheet2!A2,0)=0,"",IF(COUNTIF(Sheet1!$A:$A,Sheet2!$A2)=0,Sheet2!A2,0))
I have solved your query. Please have a look below.
First as expected, i created 2 sheets with same data as mentioned in image for simplicity.
Sheet 1 with Helper column
Sheet 2 with Helper column
Step 2 : I converted the sheet data into table for efficiency.
Step 3 : I used the COUNTIF function and IF function in Sheet 1 Helper column throughout.
=IF( COUNTIFS(Sheet2!Legal_id, [#[Legal_id]]) = 0, "N/A","" )
Similiarly we have to implement this formula in Sheet 2 Helper column.
=IF( COUNTIFS( Book1!Legal_id, [#[Legal_id]]) = 0, "N/A", "")
Explanation of above formula: The COUNTIF Function counts number of corresponding occurrences of Legal_id, in Sheet 2 Legal_id column. If count = 0 i.e means legal_id is not present in Sheet 2, so we use IF statement to assign 'N/A' value in Helper column else nothing ''.
Same explanation follows for sheet 2.
Now We Filter the Rows with N/A values to delete as mentioned by you in comments. or Insert it in third Sheet by copy paste.
The best way to accomplish your task is to use vba. But, if you want to use the ISNA(MATCH formula, you will need to wrap your formula in an IF statement and place the formula in each cell in Sheet3.
STEP 1: Paste the below formula in Cell A2
=IF(ISNA(MATCH(Sheet1!A2,Sheet2!A:A,0)),Sheet1!A2,"")
STEP 2: hold down CTRL+SHIFT+ENTER to enter it as an array formula
STEP 3: Hover over the dot in the right-bottom corner of the cell and drag down to the number of used rows you have in Sheet1 Note: the formula will change for each row
STEP 4: Then drag across to Column C Note: the formula will change for each column
The data from Sheet1 that is not in Sheet2 will now be in Sheet3, separated by blank rows, you can select the blank rows and delete them.

Conditional Formatting in different sheet

I have a 13x13 table of data on a worksheet that is comprised of links to another sheet.
For example the first row of 13 looks like:
=Sheet1!R7 =Sheet1!R20 =Sheet1!R21 =Sheet1!R22 =Sheet1!R23 =Sheet1!R24 =Sheet1!R25 =Sheet1!R26 =Sheet1!R27 =Sheet1!R28 =Sheet1!R29 =Sheet1!R30 =Sheet1!R31
I want to do conditional formatting over the entire table for when data from column R and column C of the same row are equal and >0.
For example;
When Sheet1!R7 is equal to Sheet1!C7 and >0, color the sheet 2 table (that has the link) red.
When Sheet1!R20 is equal to Sheet1!C20 and >0, color the sheet 2 table red and so on.
I would also like to repeat the process with a different colored fill if R == L and >0 but I can just use the same formula once I know how.
My attempt was =AND(Sheet1!R7=Sheet1!C7,Sheet1!C7>0).
This works for the single cell, but I'd like a way to do the whole table at once.
Any help is appreciated, thanks.
EDIT for clairty:
*I'm sure I'm not explaining it too well.
To put it simply, I have 2 columns of numbers, let's say A1:A169 and B1:B169.
I want to take the larger number from A and B for each row (A10 vs B10 etc, I used MAX function for this) and dump the output in column C.
I then aim to color code column C based on whether the number comes from column A or B. Red for A, yellow for B (no color for <0).
So far I have achieved all of this, I have the data sitting in a column color coded.
My problem comes in that I want to have the 169 numbers in column C in a more readable format, I.E. in a 13x13 grid table. I don't know how to do this and keep the color coding!*
I suppose I can offer you some possible solution.
Lets say you have sheet1 and sheet2. In sheet2, you have links to
sheet1 as you mentioned. And my understanding is that you want to color
the sheet2 (the entire table?) as red if a certain condition is met.
This is how it might be done.
In sheet 2, create a formula for a cell which reflects your condition. Lets say that is =IF(Sheet1!A1="foo", 1, 0). You can add your AND conditions in that if statement. So that cell will contain 1 if the condition is met and 0 if not met.
Select the range of cells in sheet2. Click conditional formatting. Select "use a formula to determine which cells to format". Enter the condition for the calculated value in sheet2. For example, in sheet2, my cell G1 is the result of the formula =IF(Sheet1!A1="foo", 1, 0). So if the value of G1 is 1 then I want to color the range Red.
So in essense, we are using a formula to calculate the value of a cell and using that value
as a condition to format a range of cells in Sheet2.
Hope this helps.

Is it possible to mimic excel rows in a different sheet?

So in 'Sheet 1' I have 2000 rows of information which I add a new column to every day, I want to have only a subset of the rows of 'Sheet 1' in 'Sheet 2' which update themselves as I put new columns into 'Sheet 1'. Is this possible to do using inbuilt excel functions?
If you want to select a set of particular rows and you know their row numbers, put their row numbers (1,5,8,11,12 ...) in a separate 1 column range and name this range e.g. "RowNumbers"
Then use following normal non-array formula which you can drag downwards and rightwards.
= IF(INDEX(RowNumbers,ROW(A1)+1)>0, INDEX(NamedRange,INDEX(RowNumbers,ROW(A1)+1),COLUMN(B1)+1),"")
You will probably need to adjust the +1 parts, depending on whether your values start at row 1 or 2 etc.
Basically the Excel INDEX formula does what you need - copies the value from another sheet or range by given row and column numbers.
Otherwise you can use following array formula (Ctrl+Shift+Enter) to select filtered values from columns based on multiple criteria:
= IFERROR(INDEX(NamedRange,
SMALL(IF((INDEX(NamedRange,,1,1)=1)*(INDEX(NamedRange,,2,1)="A"),
ROW(NamedRange)-MIN(ROW(NamedRange))+1,""),
ROWS(C1:$C$1)),3,1),"")
Here is an example data sheet (Sheet1)
Here is the filtered data output sheet. You should enter the array formula in the first row and drag downwards to fill expected output range. In this example I select only rowns that have values 1 and A ind filter1 and filter2 columns.

Resources