formatting a cell in a column if it is an exact match to a cell in a separate column - google-docs

I want to put a strike-through in column G if it matches the cell next to it in column F (column G is a verification of F). I found a couple formats but for some reason certain cells are not crossing off even though they match while other cells are.
Right now I have formatted G to
=COUNTIF(G:G,F1)
I have also tried
=COUNTIF(F:F,G1)
for column G as well and still some cells will cross off while others don't

A much simpler formula is:
=G1=F1
provided your Applies to range starts from G1.

Related

In Excel, how to fill blank cells in a column, with last preceding non-blank cell in row?

I need a formula that will find the last non-blank cell in each row and use that value to fill blank cells in the same row at last column. Any cells with values in the last column will remain intact. I have not tried any formula yet. The figure below may explain better:
Normally a formula cannot refer to the cell in which the formula is. It leads to the Circular Reference error.
I am not sure if you can reach the desired result using iterative calculation (which kind of allow circular references), but the general purpose of iterative calculation is for numerical methods, not for searching for the last cell in a row :)
How are your cell values filled?
If you fill them programmaticaly, you know what is in your data and you may calculate the last column in the programmatical process.
If you fill them manually, you can live with the extra last column, which you then copy over to last column (Paste Values Only).
Or, as you properly named it in your comment, you may use the "last observation carried forward" approach:
Fill all the cells with formula "copy the value from the left".
Put your data where you do have them (i.e. overwrite the formula with actual data), leave your formula in the "empty" cells where you don't have the data.
As a result, in the last column you will have either your formula carrying the last known value, or the number you entered there.
It's difficult to give you a better advice without knowing the whole process - I still suspect a kind of the X-Y problem, you have not persuaded me enough :) It is clear that you want the last measured value, but is a self-referencing formula in the last column really the only way to achieve your goal? Cannot you look at your problem out of the box and solve it otherwise?
You can create another sheet and use something like the following to fill the blanks.
Sheet1 (Data)
A
B
C
D
E
F
G
H
I
12
14
Sheet2 (Output)
A
B
C
D
E
F
G
H
I
=Sheet1!A1
=IF(Sheet1!B1,Sheet1!B1,A1)
=IF(Sheet1!C1,Sheet1!C1,B1)
=IF(Sheet1!D1,Sheet1!D1,C1)
-> Drag till end
which will result in something like this
A
B
C
D
E
F
G
H
I
12
12
12
14
14
14
14
14
14
You could use this formula in the empty cells of column L.
=LOOKUP(2,1/(A2:K2<>""),A2:K2)
To enter it in the blank cells select column L, go to Find & Select> Go To Special...>Blanks, enter the column in the formula bar and commit it with CTRL+ENTER.

Matching columns in excel

Long time lurker first time posting. I have a problem regarding matching columns in excel. I searched for different methods but I can't seem to find something that fits my needs and requirements.
I have two columns. I need to check and see if certain process's or values(column c) match a master list(column a). I have a rule set up for matches between the two columns and it highlights the matches in the master list column when compared and fills it green.
The problem I am having is that the master list contains duplicates. So two rows will have the same data. For example. a1=str123 and a4=str123.
When using the Match command, it turns both cells in column a (a1 & a4) green but this occurs even if the match column only contains one instance of the data (c5=str123).
I am looking for a way to do a Match but the master list to only turn a cell green if there is one instance of it and then ignore the match that occurred when checking for matches for another cell.
So basically I am looking for a way to setup matching between two cells but once one match has been found to ignore it when going through the rest of the list.
Any help would be appreciated.
This can be done by conditional formatting using two match formulas. I assume you have a fixed set of master values in column a, say in cells A2:A6. I will assume you have values to test if they exist in column C, say in C2:C6 and other columns are blank. In column B enter numbers 1..5 in B2..B6 as an index to the master values. In column D enter the formula =MATCH(C2,$A$2:$A$6,0) in D2 and copy down. In column E enter the formula =MATCH(B2,$D$2:$D$6,0) in E2 and copy down. Select the master range A2:A6 and choose conditional formatting, using the formula =ISNUMBER($E2) and format green fill or whatever you want. With this combination the formulas in column D find the first matching master item, and formula in col E tests to see if the index in col B is in the list of matches in col D.

Sorting and finding duplicates in excel columns

I have five columns in my spreadsheet, three of which are filled with assorted names( the first, fourth and fifth columns).
I need a way to cross-reference each cell in the A column with the D and E columns, then have an output that answers the question in the B and C column (which you can see as the Xs), as to whether it was found. I've tried a combination of VLOOKUP and MATCH, but this is proving to be out of my realm. I haven't used excel much lately.
EDIT: Added a picture instead of a diagram
In Cell B3 use =IF(COUNTIFS(D:D,A:A),"","X")
and in C3 use =IF(COUNTIFS(D:D,A:A),"","X")
copy down as far as required
Formula says "If count of names in D:D equal to name in current row in A:A is > 0 then return blank, else return "X"
Test is case-insensitive.

Highlight adjacent cell if a cell contains text from a given reference range

I have a range of reference locations on Sheet 2, column A. I have a list of locations on Sheet 1, column F. I can get the cells in Column F to highlight if they match one of the reference locations with this formula in conditional formatting: =COUNTIF(Sheet2!A:A,F4:F2500).
What I want to do is, instead of highlighting the cell that shows the location in column F, I want to highlight the adjacent cell in column G.
I've found ways to do what I already have working and I have found ways to highlight a cell based on another cell's value, but I can't figure out how to connect the two.
You can actually use the exact same formula, just apply it to the cell next to it.
I changed the formula a little, but if you create a new conditional format in G1 and use this formula: =COUNTIF(Sheet2!A:A,F1) it will compare the value in F1 to the options in Sheet2 column A and if it finds it, it will apply the format to G1. Then apply the formula to the other cells in Sheet1 column G as needed.

Find data in two lists and compare with each other

this is my first time posting here, but I didn't know where else to go.
I have two lists in excel, both of them with similar data but in different orders, each one has 3 columns (prefix (A, D), suffix (B, E) and data (C, F)).
Let's say list 1 is in columns A, B and C; and list 2 in D, E, F.
Each element in column C has an equal one in column F, but in different order and also, the previous two columns (prefix and suffix) may or may not have different values from their counterpart.
I want to do this (I guess it has to be done with macros but I don't really know, I'm not too much of an expert with excel), I want to take each element from column C (data) and find it's equivalent in column F, after that, I want to compare their prefix and suffix, and maybe paint it red when they're different and green when they're the same.
Is this possible? (and not too much of a hassle?)
If you didn't understand something, please reply and I'll be glad to try and explain better.
You can do it without macros by using conditional formatting
(There is an excellent write up of conditional formatting at Debra Dalgleish's site here. In xl2003 conditional formatting is accessed via the Format .. Conditional Formatting menu.)
If your data to be matched was in A1:F10 then these two formulas can be used to
match column C against F and return the position in F where column C has a match
compare the values in column D and E in this position to the respective values in columns A and B
format column A and B for valid matches using =A1=INDEX(D$1:D$10,MATCH($C1,$F$1:$F$10,0))
format column A and B for invalid matches using =A1<>INDEX(D$1:D$10,MATCH($C1,$F$1:$F$10,0))
In the sample below I have added these two conditional formats to cells A1:B10 in xl2010
A valid match is green
Invalid matches are red
Non matches are not formatted
So A1 and B1 are green as they match D2 (Mr) and E2 (Jones) for a common value of 1 in C1 and F2
So A3 is green as it matches D1 (Father) for 10 in C3 and F1, but B3 is red as E1 does not contain "wang"
I'd do the following:
Move column F before columns D and E (now D is the data, E is the prefix and F is the suffix)
Create three new columns G, H and I with the formulas:
=vlookup(C1, D:F, 2, 0)
=vlookup(C1, D:F, 3, 0)
=and(G1=A1,H1=B1)
Place conditional formatting on column I, with red for FALSE and green for TRUE.
The first step is necessary because VLOOKUP will look for the value in the first column of data.
On the second step, you will match the column C with column F (now moved to D) and obtain the corresponding prefix and suffixes. The next formula compares both and returns TRUE or FALSE if they both match.
You could combine all three formulas in one, if needed.

Resources