Excel - IF Function Problem - Expert Solution

Question description:
This user has given permission to use the problem statement for this blog.

In which scenario we will use the if function combined with v lookup function?
Solved by O. J. in 23 mins
This is the chat thread from the real Excelchat help session. It contains no private user information.
Excelchat Expert 16/05/2018 - 09:44
Hi, Thank you for using Got It Pro. I’m happy to be able to help you today.
User 16/05/2018 - 09:45
Hello
Excelchat Expert 16/05/2018 - 09:45
How can I help you?
Excelchat Expert 16/05/2018 - 09:45
Is there a specific task that you need help on
Excelchat Expert 16/05/2018 - 09:45
or is it just this general question
User 16/05/2018 - 09:46
In which scenario, we will use if function combined with Vlookup function?
Excelchat Expert 16/05/2018 - 09:46
there are multiple scenarios
User 16/05/2018 - 09:47
Give me an example
Excelchat Expert 16/05/2018 - 09:47
you could use the if function to change the lookup array
User 16/05/2018 - 09:49
Please go ahead
User 16/05/2018 - 09:49
with your example
Excelchat Expert 16/05/2018 - 09:51
okay in this example
Excelchat Expert 16/05/2018 - 09:52
if you check the formula in B4
Excelchat Expert 16/05/2018 - 09:52
The if function changes which table the vlookup function uses
Excelchat Expert 16/05/2018 - 09:52
so if the name is John it uses the table in range D2:E4
User 16/05/2018 - 09:52
Please mention the formula
Excelchat Expert 16/05/2018 - 09:52
otherwise if uses the table in G2:H4
Excelchat Expert 16/05/2018 - 09:52
=VLOOKUP(B3,IF(B2="John",D2:E4,G2:H4),2,0)
User 16/05/2018 - 09:54
Ok
Excelchat Expert 16/05/2018 - 09:55
Is there anything else I can help you with regarding this matter?
User 16/05/2018 - 09:57
In the excel, b2 is Tom know, then how could you mention b2="john"in the formula
User 16/05/2018 - 09:57
And you got the tom's gas expenses as 30
Excelchat Expert 16/05/2018 - 09:57
Yes because the formula checks if the value is john
Excelchat Expert 16/05/2018 - 09:58
if it is john then it uses the table of john
Excelchat Expert 16/05/2018 - 09:58
Any other result will use the table of Tom
Excelchat Expert 16/05/2018 - 09:58
So if the name is not john
Excelchat Expert 16/05/2018 - 09:58
it will use the other table
User 16/05/2018 - 09:58
Alright
Excelchat Expert 16/05/2018 - 09:59
When you are done with the session please click on end session. Have a great day ahead :)
User 16/05/2018 - 09:59
This is the basic example, right?
Excelchat Expert 16/05/2018 - 09:59
there are lots of examples
User 16/05/2018 - 09:59
we can use it complex issue as well, is it correct?
Excelchat Expert 16/05/2018 - 09:59
the sky is the limit
Excelchat Expert 16/05/2018 - 09:59
yes of course
User 16/05/2018 - 10:00
Tq for the explanation
Excelchat Expert 16/05/2018 - 10:00
My pleasure
Excelchat Expert 16/05/2018 - 10:01
When you are done with the session please click on end session. Have a great day ahead :)

This is the output file from the real Excelchat help session:
This is an example of the expert help you can get. It contains no private user information.

Get instant expert help with Excel and Google Sheets

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Your privacy is guaranteed. Your session will not be used for blog unless you give us persmission.

Click here to get your free Excelchat help session

Subscribe to Excelchat.co
Trusted by people who work at
Amazon.com, Inc
Facebook, Inc
Accenture PLC
Siemens AG
Macy's
The Allstate Corporation
United Parcel Service
Dell Inc