# Look up Values

#### Colleen45

##### Active Member
I am battling to structure this complex formula.
Again in a library scenario.
In Col S, it needs to check the number from Col R (card number), if it exists in Col A, if it does not exist, issue a message "Card not registered"
If it is in Col A, it needs to check if the card has expired or not from the expiry date in Col D, if it has expired issue a message "Card expired"
If the card is in Col A and it has not expired insert the card holders name from Col B into Col S
If there no card no. in Col R, Col S be "" as opposed to the standard message #N/A.
Your help would be greatly appreciated

### Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

#### Scott Huish

##### MrExcel MVP
OK, I'm a little confused at the first line:

In Col S, it needs to check the number from Col R (card number), if it exists in Col A, if it does not exist, issue a message "Card not registered"

So, you want to say "Card not registered" whether it is in Column A or not?

#### Colleen45

##### Active Member
I would like it to say "Card not Registered" if it is Not in Col A, if it is in Col A then proceed to the next part of the statement

#### Scott Huish

##### MrExcel MVP
OK, that makes more sense.

Perhaps:
Code:
``=IF(R1="","",IF(COUNTIF(A:A,R1),IF(VLOOKUP(R1,A:D,4,0)<TODAY(),"Card expired",VLOOKUP(R1,A:B,2,0)),"Card not registered"))``

#### Colleen45

##### Active Member
You are a Genius, thank you so much, it works EXACTLY as required
God Bless

Replies
1
Views
795
Replies
0
Views
392
Replies
0
Views
726
Replies
0
Views
203
Replies
1
Views
321

1,181,649
Messages
5,931,217
Members
436,784
Latest member
amuljono

### 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?

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