I'm trying to build a lookup & logic statement together.

Anonymous
2025-06-27T20:47:50+00:00
Hi. I have a table in one excel sheet with location codes and if they are active or inactive. I need to build a lookup in daily invoice coding excel sheet to see if the location code is active or inactive before I upload the billing allocation. Is there a formula that can look up a code in sheet 1, wb 1, and return the value listed ("Active or "Inactive) on the table in sheet 1, wb2? If so, how can I do this? Do I need to build a lookup first and then an if, than statement or can it be one formula?

Sorry, unable to provide screen shots but looks like this.

WB1 - INVOICE COST ALLOCATION

LOC # SUM OF TOTAL
H0001 $420.81

WB2 - TABLE

LOC # PARENT ID STATUS
H0001 E001 ACTIVE
Microsoft 365 and Office | Excel | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ashish Mathur 99,580 Reputation points Volunteer Moderator
    2025-06-28T01:58:07+00:00

    Hi,

    Write this formula in cell C2 of wb2

    =if(countif(reference of data in column A of wb1,A2)>0,"Active","Inactive")

    Hope this helps.

    0 comments No comments