VLOOKUP + IF + AND help required please.

tammorice

New Member
Joined
Oct 13, 2015
Messages
23
Hi everyone. I have found myself in a spiral of inadequate formulas. I do hope someone can help me out. So this is what we have.

ID numbers in file are reconciled with a download of ID numbers from the Regulator website. I want to have an entry populated in the 'Validity' column after matching the ID numbers and then confirming the status as OK (if GENR) and INVALID (if 'Not valid).

If an ID number listed (on file) is not in the ID number download column from the Regulator, the ID number in the 'on file' column is highlighted.

There will be multiple copies of ID numbers listed against jobs in the file column, and only a single ID number in the download column.

Thanks to everyone who reads and provides comments/feedback.

ID number - on fileID number - download (status/validity)Status - download (status/validity)Validity - file reconciliation
1269006810146637GENR[OK / INVALID]
1159647010686175GENR[OK / INVALID]
8079254811596470Not valid[OK / INVALID]
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hello Please try this, I hope it helps

Book1
ABCD
1ID number - on fileID number - download (status/validity)Status - download (status/validity)Validity - file reconciliation
21269006810146637GNROK
31159647010686175GNROK
48079254811596470Not ValidINVALID
Sheet1
Cell Formulas
RangeFormula
C2:C4C2=IF(ISNUMBER(VLOOKUP(B2,$A$2:$A$4,1)),"Not Valid","GNR")
D2:D4D2=IFS(C2="GNR","OK",C2="Not Valid","INVALID")
 
Upvote 0
Thank you for the quick assistance. I didn't explain myself very well, so I thought I'd provide a little more info on what I need and an extract of the file

Background
  • I am required to check that each of the employees have a valid ID before performing the assigned job. (note that an employee may have more than one job for the day - column A has 200 lines).
  • I upload a csv of employee ID numbers (column D 162 lines) to the regulators website.
  • The Regulator then provides a file containing columns D and E with E being the status.
  • Depending on the status in column E, a response is generated in column C (Approved) of "OK" or "INVALID"
  • My formula doesn't account for the employee ID existing but being 'not current' and therefore employee cannot perform work that day.
So Column C = the result of answering 2 questions.
  1. is the employee ID in column A also in column D;
  2. is the status of the employee ID in column A 'not current'
Answers:
  • Query 1 above is true(then lookup status),
    • status is 'not current' (then return "INVALID in column C - next to job No.), OR
    • status is any value other than 'not current' (then return "OK" in column C - next to job No.)
  • Query 1 above is false (then return "INVALID" in column C - next to job No.)
i.e. in the example below C15 should = INVALID (and against all other jobs for that employee ID value in column A)

VLOOKUP QUESTION.xlsx
ABCDE
1Employee ID No. (file)Job No.ApprovedEmployee ID No. (download)ID Status (download)
21269006898966OK10146637GENR
33055001998967OK10686175GENRSCHE
42731704398970OK11596470GENRSCHE
510216222398971OK11610117GENR
62377678498972OK12500988GENRSCHE
712222650498973OK12661274GENR
88566907398974OK12690068GENR
91661666898975OK12856812GENRSCHE
1012586253198977OK13108731BHTXGENRSCHE
1110745269098976OK13203489GENRSCHE
121432319798979OK13229285GENRSCHE
133225009098978OK13234585GENR
141958509998980OK13235289GENR
151509613198981OK14323197Not current
162271784598983OK14755986GENRSCHE
173828752198982OK15004509GENRSCHE
182731704398984OK15069563GENR
192945560098985OK15096131GENRSCHE
204060554698987OK15280216GENRSCHE
211068617598986OK16616668BHTXLIMOGENRSCHE
Sheet1
Cell Formulas
RangeFormula
C2:C21C2=IF(VLOOKUP(A2,$D$2:$D$162,1,FALSE),"OK","INVALID")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E:ECell Valuecontains "not current"textNO
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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