Change Vlookup Return Value using IF, LEN and Vlookup

omcsarayar

New Member
Joined
Oct 20, 2022
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
Hi everyone,
I am currently struggling to manipulate the return value of vlookup using the combination of IF, LEN and Vlookup
If from Sheet A it returns "Male", i need the value in Sheet B to be "M". if not then just blank.

i'm relatively new to excel or google spreadsheet, so i have included my spreadsheet link to better explain my current situation. (it's a sample, but the same format as my real sheet)
my spreadsheet link: Work sample

as you can see on the spreadsheet i tried using this formula:
=IF(LEN(VLOOKUP(B2,A!A2:F8,3,0))=Male,"L",VLOOKUP(B2,A!A2:F8,3,0)"")
but it doesnt work, it returns #ERROR

is there a way for me to do this?
any help will be much appreciated.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(VLOOKUP(B2,A!A2:F8,3,0)="Male","M","")
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(VLOOKUP(B2,A!A2:F8,3,0)="Male","M","")
omg, it works. thankyouu so much!
now i see i've overcomplicate the formula, such a noob haha. thankyou again:))
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,826
Messages
6,181,192
Members
453,021
Latest member
pingpong7117

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