Excel – How to mark a cell if another cell contains data from a list in Excel

microsoft excelworksheet-function

I am working on a spreadsheet and I need to have a way to mark items that have been recently ordered.

Each row is an item in inventory. I have a separate list of item numbers that have been recently ordered.

I need a function that will look to see if the item number for each row (column A) is also present in my list (Column A on another sheet, "Recent POs") and flag those rows accordingly, perhaps by returning a message such as (recently ordered).

I've tried a handful of things and am struggling. This seems like it should be easy.

Any thoughts?

Best Answer

You can do this with a simple CountIF() of the items ordered, nested in an IF() statement. If the count is zero, the "False" part of the IF() statement will be executed. If the count is greater than zero, the "True" part of the IF() will be executed, since any value other than 0 is equal to TRUE. So, in your first sheet, enter this into row 2 and copy down.

=IF(COUNTIF('Recent POs'!A:A,A2),"recently ordered","")

For an example see:

enter image description here

Related Question