numbers with a "G" infront (sometimes) leave out the G

Bandito1

Board Regular
Joined
Oct 18, 2018
Messages
233
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I use the following formula to check if numbers are in a list or not;

=IF(ISNA(VLOOKUP(K9;'2016-2022'!B:B;1;FALSE));"No";"Yes")

Sometimes the number contains a G infront. The G should not be seen.

G333114 should be 333114

But not always the G is infront.

Is there a way to add something that IF there is a G infront it should be not looked at?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
try this
-------------
Book1
BCDEFGHIJKL
1231123Yes
2g123231Yes
3g456456Yes
4889888No
5g765765Yes
6g147147Yes
7147982No
8356357No
Sheet1
Cell Formulas
RangeFormula
L1:L8L1=IF(ISNA(VLOOKUP(K1,IF(ISNUMBER(B:B),B:B,VALUE(RIGHT(B:B,LEN(B:B)-1))),1,FALSE)),"No","Yes")
 
Upvote 0
Another option
Excel Formula:
=IF(ISNA(VLOOKUP(SUBSTITUTE(K9;"G","")+0;'2016-2022'!B:B;1;FALSE));"No";"Yes")
 
Upvote 0
is the occasional "G" in column '2016-2022'!B or column K?
 
Upvote 0
if the occasional "G" is in K, then
--------------
numbers with a G infront sometimes leave out the G-lookup trim.xlsx
BCDEFGHIJKL
1123231Yes
2231g123Yes
3456g456Yes
4888889No
5765g765Yes
6147g147Yes
7982356No
8357982Yes
g in K
Cell Formulas
RangeFormula
L1:L8L1=IF(ISNA(VLOOKUP(IF(ISNUMBER(K1),K1,VALUE(RIGHT(K1,LEN(K1)-1))),B:B,1,FALSE)),"No","Yes")
 
Upvote 0
Another option
Excel Formula:
=IF(ISNA(VLOOKUP(SUBSTITUTE(K9;"G","")+0;'2016-2022'!B:B;1;FALSE));"No";"Yes")
The value stays "Yes" if there is no text in the lookup column, can it be blank if there is no value entered?
 
Upvote 0
How about
Excel Formula:
=if(K9="";"";IF(ISNA(VLOOKUP(SUBSTITUTE(K9;"G";"")+0;'2016-2022'!B:B;1;FALSE));"No";"Yes"))
 
Upvote 0
Solution
if the occasional "G" is in K, then
--------------
numbers with a G infront sometimes leave out the G-lookup trim.xlsx
BCDEFGHIJKL
1123231Yes
2231g123Yes
3456g456Yes
4888889No
5765g765Yes
6147g147Yes
7982356No
8357982Yes
g in K
Cell Formulas
RangeFormula
L1:L8L1=IF(ISNA(VLOOKUP(IF(ISNUMBER(K1),K1,VALUE(RIGHT(K1,LEN(K1)-1))),B:B,1,FALSE)),"No","Yes")
Works also :)
But also, the value stays "Yes" if there is no value entered in the lookup column
 
Upvote 0
The value stays "Yes" if there is no text in the lookup column, can it be blank if there is no value entered?
Excel Formula:
=IF(K1="","",IF(ISNA(VLOOKUP(IF(ISNUMBER(K1),K1,VALUE(RIGHT(K1,LEN(K1)-1))),B:B,1,FALSE)),"No","Yes"))
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,051
Latest member
excelquestion515

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