# IF Statement

#### Deonvg

##### New Member
Hi all,

I have the following table with data and it references against a "lookup" table (column K:L).

Somehow I need to combine a IF formula to do all the of the below, have tried doing it with "OR & AND", but just don't seem to be getting it correct. Pending on the combination of Country in "lookup table" & column A it needs to bring back Foreign

Your help would be appreciated.

Thanks in advance.(sorry can't install proper paste tool for excel as i'm on my work laptop)

ABCDEFGHIJKLM
1
2Type of incomeCountry of source of incomeUSDLookup table
3Royalty feeBotswana5000=IF(A2="Royalty Fee", "Foreign","Local")Royalty feeBotswana
4ClientSwaziland10000=IF(A3="Client", "Foreign","Local")ClientSwaziland
5Franchise feeLesotho4500=IF(A4="Franchise Fee", "Foreign","Local")Franchise feeLesotho
6InterestUganda3000=IF(A5="Interest", "Foreign","Local")InterestUganda
7IT ChangeGhana1000=IF(A6="IT Change", "Local","Foreign")IT ChangeGhana
8CommissionZambia500=IF(A7="Commission", "Local","Foreign")CommissionZambia
9But / OR
10=IF(OR(A7&B7=\$L\$7&\$M\$7,A8&B8=\$L\$8&\$M\$8,A8&B8=\$L\$8&\$M\$3),"Foreign","Local")
11
12

<tbody>
</tbody>
Sheet1

Last edited:

#### JackDanIce

##### Well-known Member
Instead of a long nested IF statement, you could set up a VLOOKUP table and use that, which would be easier

#### Deonvg

##### New Member
Instead of a long nested IF statement, you could set up a VLOOKUP table and use that, which would be easier
I would still have to create some kind of unique identifier to bring in the variable of last 2 income types. If any of those 2 income types match with any of the countries in column "L" I want a value of "Foreign" to be returned, but if the income type and country doesn't match it should be local.

If the income type for the last 2 doesn't match with a certain country it should be local, thus the amount of unique identifiers would increase quite drastically

Income types form A3:A6 should immediately give me Foreign.

#### thisoldman

##### Well-known Member
Try this.
=IF(((A3="IT Change")+(A3="Commission"))*ISNUMBER(MATCH(B3,\$L\$3:\$L\$8,0)), "Local", "Foreign")

Or this, using AND and OR.
=IF(AND(OR(A3="IT Change",A3="Commission"),ISNUMBER(MATCH(B3,\$L\$3:\$L\$8,0))), "Local", "Foreign")

### Forum statistics

1,082,323
Messages
5,364,579
Members
400,809
Latest member
formulasataglance

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...