VLOOKUP return for three conditions?

kznmrexcel

Board Regular
Joined
Jun 16, 2010
Messages
86
Office Version
  1. 2016
Platform
  1. MacOS
I need a formula that will return one of three things:
1. If the Comments column (column B on cbBarcodeScans sheet) has the letter code g, return "Device issued with Gumdrop case." (No underline)
2. If that same Comments column (column B on cbBarcodeScans sheet) is blank, return blank. (Not the text "blank," but return a blank cell.)
3. If the number we're looking up from cell R2 is not present on cbBarcodeScans sheet in column A, return "Not scanned."

This is where I started, but I need help putting in the conditions:
=VLOOKUP(R2,cbBarcodeScans!$A:$B,2,FALSE)

TIA
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Not going to recreate your scenario exactly, but try this:

data (4).xlsx
ABCDEFG
2
3NumberLookupCommentsR2 ValueFormula Result
419Not Scanned
527 
636 
74g8Not Scanned
85blank B1 
962 
1074Device Issued with Gumdrop Case
113 
125 
1310Not Scanned
kznmrexcel
Cell Formulas
RangeFormula
G4:G13G4=IF(ISNA(VLOOKUP($F4,$A$4:$B$13,2,0)),"Not Scanned", IF(VLOOKUP($F4,$A$4:$B$13,2,0)="g","Device Issued with Gumdrop Case", IF(VLOOKUP($F4,$A$4:$B$13,2,0)="","",2)))
 
Upvote 0
Upvote 0
Hi @kznmrexcel.

1. If the Comments column (column B on cbBarcodeScans sheet) has the letter code g
If it's the letter "g" you're looking for, then it could be:

Cell Formulas
RangeFormula
S2:S11S2=IFERROR(IF(VLOOKUP(R2,cbBarcodeScans!A:B,2,0)="g","Device issued with Gumdrop case",""),"Not scanned")


Data in cbBarcodeScans sheet:
Dante Amor
AB
1NumberLookupComments
21
32
43
54g
65
76g
87
cbBarcodeScans
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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