Solved

If with Vlookup

Posted on 2014-09-09
11
184 Views
Last Modified: 2014-09-11
Can an Expert solve this for me please.

I need a formula in C4 to say:

If H4 is Blank then C4 is blank. If J4 or K4 = B12345 Vlookup H4,Client,2,0 IF K4 = C12345 Vlookup H4 House,2,0

Thank you in advance
0
Comment
Question by:Jagwarman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40312318
=IF(H4="","",IF(OR(J4="B12345",K4="B12345"),VLOOKUP(H4,Client,2,0),IF(K4="C12345",VLOOKUP(H4,House,2,0))))

I have assumed B12345 and C12345 are cell values rather than cell references. If cell references, just remove the double quotes around those values.

Are there other scenarios that need to be considered?

Thanks
Rob H
0
 

Author Comment

by:Jagwarman
ID: 40312345
I made a mistake Rob

IF K4 = C12345 Vlookup H4 House,2,0


should read

IF J4 OR K4 = C12345 Vlookup H4 House,2,0
0
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40312352
Hi,

pls try

=IF(H4="","",IF(OR(J4="B12345",K4="B12345",J4="C12345",K4="C12345"),VLOOKUP(H4,Client,2,0),""))

Regards
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Closing Comment

by:Jagwarman
ID: 40312372
Brilliant many thanks
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40312394
@jagwarman - the solution that you have accepted only looks at Client. Do you not need it to look at House in the second scenario?

If so:

=IF(H4="","",IF(OR(J4="B12345",K4="B12345"),VLOOKUP(H4,Client,2,0),IF(OR(J4="C12345",K4="C12345"),VLOOKUP(H4,House,2,0))))
0
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 40312435
Rob's right
I was carried away
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40314294
Another shorter option, assuming only two options B12345 or C12345:

=IF(H4="","",VLOOKUP(H4,IF(OR(J4="B12345",K4="B12345"),Client,House),2,0))

If there are other options for J4 & K4:

=IF(H4="","",VLOOKUP(H4,IF(OR(J4="B12345",K4="B12345"),Client,IF(OR(J4="C12345",K4="C12345"),House)),2,0))

This allows for the second option (C12345), are there others? This allows for only B12345 and C12345, other values in J4 or K4 will give an error. Is there a common theme for each, such as these begin with B or C. If there is a common theme, it can probably be shortened even further with a helper table.

Thanks
Rob H
0
 

Author Comment

by:Jagwarman
ID: 40314506
Rob you are right I meant to accept your solution. it must have been late in the day. Sorry and thanks for the alternatives

Rgonzo, give Rob the points :-)
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40314602
You will have to submit a Request for Attention to action that.

Thanks
Rob
0
 

Author Comment

by:Jagwarman
ID: 40316933
do you want me to do that Rob?
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40317041
The moderators wont accept such a request from any one else.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question