ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF/AND VLOOKUP question... (https://www.excelbanter.com/excel-discussion-misc-queries/169828-if-vlookup-question.html)

Kevin

IF/AND VLOOKUP question...
 
Hi, here's what I'm looking for... column A lists days of the week. Column E
list room numbers. Column C lists codes. This data will change often and may
list days, codes or rooms more than once. I would like to set a condition
such as: if a row contains "Monday" and Room "1" then return the code in
column C from the same row. This was easy to do when I chose specific cells,
but because the info may change within the columns, I need to formula to look
at whole columns or ranges. So, anytime a row matches Monday and room 1,
wherever it is, column C code is returned. I've come close using IF ((AND
statement but it won't allow me to use ranges...any ideas?

Max

IF/AND VLOOKUP question...
 
Assume source data as described starts in row2 down

Assume inputs for the day and the room number
will be made in G2:H2 down, eg
in G2: Monday
in H2: 1

then you could place in I2, and array-enter the formula by pressing
CTRL+SHIFT+ENTER:
=IF(COUNTA(G2:H2)<2,"",INDEX(C$2:C$100,MATCH(1,(A$ 2:A$100=G2)*(E$2:E$100=H2),0)))
Copy I2 down as far as required. Adapt the ranges to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Kevin" wrote:
Hi, here's what I'm looking for... column A lists days of the week. Column E
list room numbers. Column C lists codes. This data will change often and may
list days, codes or rooms more than once. I would like to set a condition
such as: if a row contains "Monday" and Room "1" then return the code in
column C from the same row. This was easy to do when I chose specific cells,
but because the info may change within the columns, I need to formula to look
at whole columns or ranges. So, anytime a row matches Monday and room 1,
wherever it is, column C code is returned. I've come close using IF ((AND
statement but it won't allow me to use ranges...any ideas?


Kevin

IF/AND VLOOKUP question...
 
Thank you Max, it worked fine. As always, your fast, accurate response made
someone else's life a lot easier. Much appreciated, -Kevin



Max

IF/AND VLOOKUP question...
 
Welcome, and glad it worked fine for you, Kevin.
Appreciate the feedback.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Kevin" wrote in message
...
Thank you Max, it worked fine. As always,
your fast, accurate response made
someone else's life a lot easier. Much appreciated, -Kevin






All times are GMT +1. The time now is 01:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com