Vlookup and If statements

Cavesim

New Member
Joined
Jun 28, 2015
Messages
7
Hi All,

I will try and explain my problem and hope you can help.

I need to identify data on one table using a vlookup, if that data contains certain text (ABC) i need it to then get the cell to display data from another cell within the same table.


Below are fragments of the data set

Main Table where data needs to be displayed:

Missing Field is ABC Contract Expiry Date (ABC is a service line)

I use a vlookup to reference customer name (Australia)

CustomerABC SpendABC Share Of WalletABC Product Numbers Sold ABC Contract Expiry Date
Australia $ 508,170.45100%48,406Missing Data

<tbody>
</tbody>


I have another table which holds the contract information


CompanyGroup CodeContract StatusContract Start DateContract End Date
AustraliaAUSABC;ZBA;Active18/09/200817/09/2011

<colgroup><col><col><col><col span="2"><col></colgroup><tbody>
</tbody>


I need to check the contract cell to see if it contains "ABC" and if it does then show the contract end date where the first table says missing data.

Hopefully the above is clear.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
If the first table is in sheet 1 and the second table is in sheet 2 columns A to F, type this in the ABC Contract Expiry Date cell:

Code:
=INDEX(Sheet2!F:F,MATCH(1,(IF(ISNUMBER(SEARCH("ABC",Sheet2!C:C)),1,0))*(Sheet2!A:A=Sheet1!A2),0))

In sheet 2:
F is the column which contains the contract end date
C is the column with Contract
A is the column with the Company
In sheet 1:
C2 is the Customer column from the first table.

Hope this was clear enough
Alex
 
Upvote 0
Hi Alexander - Thought it worked but it gives me an NA# value.

I will try and play around with the formula now that i have seen how you have structured it.

Thanks again for giving it a go and helping me with my problem
 
Last edited:
Upvote 0
Hi Alexander,

When i look at the calculation steps it all works well bar the this component

=INDEX(Sheet2!F:F,MATCH which equals NA#
 
Upvote 0
Try confirming the formula by simultaneously pressing Ctrl+Shift+Enter not just enter. Forgot to mention that. Sorry

Alex
 
Upvote 0
Code:
=IFERROR(INDEX(Sheet2!F:F,MATCH(1,(IF(ISNUMBER(SEARCH("ABC",Sheet2!C:C)),1,0))*(Sheet2!A:A=Sheet1!A2),0)),"No NA")
A normal iferror will suffice. You can put in any text or any cell/formula at the end where I wrote "No NA". If you want something other than text do not add the apostrophe "".

Alex
 
Upvote 0

Forum statistics

Threads
1,215,679
Messages
6,126,177
Members
449,296
Latest member
tinneytwin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top