Excel - Compare one column to another and display results - function

In Excel 2007, I have two columns, similar data (list of names). If the name is found in both columns I'd like to change a blank column to active. How can this be done?
Longer Description of what I'd like to do:
Column A:A on Sheet 1 has 300 names. Column A:A on Sheet 2 has 20 names. If the names on Sheet 2 are also in Sheet 1 I'd like to fill Column A:B on Sheet 1 with the word "Active"
How can this be done? Thanks in advance!

Assuming you had the names in Column A of both sheets, In cell B1 of Sheet1, put in the following formula:
=IF(ISNUMBER(MATCH(A1,Sheet2!A:A,0)),"Active","Not Active")
You can then drag that formula down - If the name exists in BOTH, it will say "Active" otherwise it will say "Not Active".
Hope this helps.

This can be handled with a simple VLOOKUP formula:
=IF(VLOOKUP(Sheet2!A1,Sheet1!A:A,1,FALSE)=A1,"Active","")
The above formula is placed in cell B1 on Sheet1 and then copied down as far as there is data in column A on sheet 1.
The only caveat with this formula is that the data in Sheet2 column A must be sorted alphabetically.
The FALSE near the end of the formula indicates that an exact match is required.

Related

How do I use a formula written in one cell, in another cell (Google sheets)?

I have created a formula to get all sheet names (column A), with which a formula column has been created (column B), now how do I execute those exact formulas written in column B in column C?
The sheet
Would highly appreciate it if someone has a solution to this or maybe a workaround.
What I tried:
INDIRECT won't work, I'll post the error it shows.
Error message
Also, EVALUATE function is not available in google sheets.
I have created an example. I have two sheets 01/02 and 02/03. In cell A2 of 01/02 the text "Hello". In cell A2 of 02/03 the text "Good bye". Now in Sheet1 I have in column A as Plain Text 01/02 and 02/03, the sheet names. Then in column B a formula using INDIRECT.

Can I show the results of COUNTIF in one column only if there is data in another column?

I have a spreadsheet with multiple sheets.
Sheet A is generated from a template, and it is where users will enter in data to be formatted into a report; it will be deleted after that report is submitted.
As people enter info into Column A of Sheet A, they don't have to enter client information if we already have them entered in this spreadsheet, but otherwise they need to go over to Sheet B and enter it in.
To make it easier for them (so they don't have to check every time, or go back and enter info later after getting an error generating the report), I have used conditional formatting. The way it works is, column Z is set up as a helper column, and uses a "COUNTIF" function to check if the client ID in Sheet A, Column A is found in Sheet B, Column C. Sheet A Column Z returns 0 or 1 (or, theoretically, more than one if we had duplicates), and then Sheet A column A has conditional formatting based on Column Z's value-- if the client is already in, the cell for client ID turns green after they type it; if not, it turns red.
It works great! However, I am adding scripts to these sheets, and looping through them. This helper column is filled from Z1 to Z1000, which means I can't use sheet.maxRow() to get the last row.
I see plenty of workarounds on the script side, but I was wondering if anyone has a clever way to input a value into the helper column Z ONLY IF the corresponding cell (same row) in column A has a value using spreadsheet formulas.
I suspect that an array formula with a filter might do it, but I have little experience with either and can't get anything to work out.
Thanks for your help!
You can use this expression with INDEX, MAX and ROW to make an ARRAYFORMULA only expandable until the last cell with value in column:
A2:INDEX(A2:A,MAX(ROW(A2:A)*(A2:A<>"")))
It will go from A2 to the maximum number of row in A in which A is different than null (that's why both conditions are multiplied).
Then you can set a formula like this in Z2 (check the ranges in case something is not right from reading your text, and delete all other formulas in Z too in case you weren't using an arrayformula already):
=BYROW(A2:INDEX(A2:A,MAX(ROW(A2:A)*(A2:A<>""))),LAMBDA(each,IF(each="","",COUNTIF('Sheet B'!C:C,each))))

Pull Entire column from different sheet without zero's

how to pull column from different sheet..
I've a sheet using the below formula to get the column(n rows) from Sheet1 to Sheet2 however I'm getting zeros after nth row. How to avoid zeros here ??
=IF(NOT(ISBLANK(Sheet1!C1)),Sheet1!C:C,"")
I'm doing the same for A,B,C columns to get data from Sheet1 to Sheet2. Any better formula ?
zeros are coming because the original column doesn't have data after nth row. for example if zero occur at 301 for column c means data in the column C has values upto 300 rows.
we can avoid this issue in two ways
stop copying formula after you get zeros
or
Put a unique word in the formula (here stopcopying)
=IF(LEN(IF(NOT(ISBLANK(Sheet1!C12)),Sheet1!C:C,""))=0,"stopcopying",IF(NOT(ISBLANK(Sheet1!C1)),Sheet1!C:C,""))
Find "Stopcopying" keyword and replace without giving any word ( ctrl F and R)
This is the only way I can see and this answered my question:
=FILTER($B:$E,(B:B<>""))

How to crossmatch data of a column with multiple column and take action if it matched?

Here I have two sheets in google spreadsheet.
Please check the screenshot
I would like to automatically search all the single data of column A of Sheet 2 in Column A and C of Sheet 1 and if it matched it would make the checkboxes ticked on column B and D of sheet 1 and if its not matched it would leave it as it was. I have attached that screenshot which is the result I expect. Is there any functions or script to do this?
I'm not familiar with such staffs. A help would be greatly appreciated.
Thanks
you do not need to write a script for this - an array formula can do it all
to the formula start working - you need to clear out everything from the range B1:B7 . then paste the formula =ArrayFormula(IFNA(VLOOKUP(A1:A7,Sheet2!$A:$A,1,false),)=A1:A7) into cell B1, then select range B1:B7 and paste checkboxes through the menu Insert - Checkbox
the formula for the range D1:D7 is inserted in the same way
=ArrayFormula(IFNA(VLOOKUP(C1:C7,Sheet2!$A:$A,1,false),)=C1:C7)
after some thought, came to the conclusion that the formulas could be much simpler
=ArrayFormula(COUNTIF(Sheet2!$A:$A,A1:A7)>0) for cell B1
=ArrayFormula(COUNTIF(Sheet2!$A:$A,C1:C7)>0) for cell D1

How to import data from a sheet where sheetname is dependent on a cell value

I have been trying to make a Google Sheet for some purpose which shall have details of various movies.
Here is the link: https://docs.google.com/spreadsheets/d/10-4BWaK-zmTxmqr2ov7AvjQW-wAFR8NKXkICuCK1dTY/edit?usp=sharing
Now I wish to count the number of movies per year where sheet name is dependent on cell value.
For example, in Sheet: "Data" I wish that B2 shows the count of movies in Sheet named '2019' but I don't want it to be written as '=COUNTA('2019'!A:A). Instead I wish that the sheet name automatically gets picked up from cell A2. So if I change the year in A2, the Count in B2 should change automatically.
I tried using INDIRECT and MATCH function as =COUNTA(INDIRECT(A2,false)) and =MATCH(A2,INDIRECT(A2),1) but I think I made some errors.
Also in the same way I wish to count in C2 but with a condition: to count only those cells from G column where value is watched
In B2 try
=sumproduct(INDIRECT(A2&"!A3:A")<>"")
and see if that works?