Solved

VLOOKUP data in excel and return associated value.

Posted on 2013-01-29
16
231 Views
Last Modified: 2013-01-31
I have an excel table with the following in it...

PROCESS,STATE,REFERENCE
1,OK,3654732
2,OK,2343242
3,WARNING,2342349
4,WAITING,2342342
5,WAITING,2342342

What I am looking for is a formula that will get the 'State' column that has the 'WARNING' value and based on whatever row of data that is in return me the associated value in the 'Reference' column - in this example 2342349.

Any ideas, I am guessing a VLOOKUP?
0
Comment
Question by:Blowfelt82
[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
  • 7
  • 5
  • 3
  • +1
16 Comments
 
LVL 5

Expert Comment

by:KyleSW
ID: 38831256
It's not clear exactly what you're looking for, do you want to return all references for all warning States? Or are you wanting to look up a Process and return the reference if the State is "warning"?
0
 
LVL 23

Expert Comment

by:NBVC
ID: 38831270
Try:

=VLOOKUP("WARNING",B:C,2,FALSE)

where data is in A:C

What if there are two rows with WARNING, like you have for WAITING or OK.  This formula extracts first match only.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38831272
If your data is in columns A, B, C then the formula should be

=vlookup("WARNING",B:C,2,0)

This will give the result for only the first warning in the column
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:Blowfelt82
ID: 38831283
Thanks I will give this a go, as for the comments in this scenario there will only ever be one warning at a time so this solution should work. Also I forgot to mention this formula should reference a different worksheet named 'Overview'. So I guess...


=VLOOKUP("WARNING",Overview!B:C,2,FALSE)

I will give this a go...
0
 

Author Comment

by:Blowfelt82
ID: 38831326
When I try the above I get a Bad name or workbook open error message? This may be my fault as in the data the 'STATE' column is in column F and the REFERENCE column is in column I. I excluded these before for brevity... I amended the formulas above to suit this structure as follows...

=VLOOKUP("WARNING",Overview!F:I,4,FALSE)
0
 
LVL 23

Expert Comment

by:NBVC
ID: 38831363
Does it work with that new configuration?
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38831387
Make sure that the WARNING is in column F
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38831400
Check the spelling of Overview. Even leading/trailing spaces do matter.
0
 

Author Comment

by:Blowfelt82
ID: 38831407
Unfortunately not. This looks to be a context thing, if I take the amended formula into the spreadsheet and run from there it works as expected... The formula being...

=VLOOKUP("WARNING",Overview!F:I,4,FALSE)

But I am using the formula as part of a web data query and am using the formula to populate a parameter... Perhaps there are different rules here as to the formulas that can be used?
0
 

Author Comment

by:Blowfelt82
ID: 38831418
Full error is...

Could not obtain parameter from reference (Bad name or workbook not open). Proceed to prompt for value?
0
 
LVL 23

Expert Comment

by:NBVC
ID: 38831433
So you are typing that formula into a cell or trying to put it somewhere else?  Maybe you have downloaded some invisible characters from the web.

You may have to use the CLEAN function on column F, in another column, then copy/paste special values back to F, to get rid of them, then retry the VLOOKUP.  or use Find/Replace and replace 016 (using number pad) with nothing.
0
 

Author Comment

by:Blowfelt82
ID: 38831442
The web query path I am using is OK as far as I can tell and returns what I would expect, the formula is had typed so I dont think this is the cause?
0
 
LVL 23

Expert Comment

by:NBVC
ID: 38831457
So how exactly are you implementing the formula?  I am not sure I follow.
0
 

Author Comment

by:Blowfelt82
ID: 38831503
Ok,

I have imported data using an excel web query which imports tabular data from an online source. I have added a parameter to this query so that I can configure the actual web query parameters used each time I refresh the data - at present every time I refresh the data a prompt shows asking me to manually input the data (which all works OK).

However one of the options for this is instead of inputting the data manually I want to use a web query formula to lookup the data from an existing cell? Does that help, any questions fire away,
0
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 38831576
I don't usually do web queries, but can you put the formula in a cell, then point the parameter to that cell so it uses the result?
0
 

Author Closing Comment

by:Blowfelt82
ID: 38839648
Yep worked like a charm, a bit annoying I could not do it by using the formula directly but if it works I am happy. Thanks for your time.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

738 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