Check range for value, THEN check value of specific column in that row, THEN return TRUE/FALSE.

Unsolved

Examples are just that, but they are the same use-case.

​

I have a VLOOKUP that checks another sheet for a specified vegetable. On finding "carrot" it returns "vegetable". If it does not find "carrot", it returns "not vegetable".

However, what I want to be able to do is check the other sheet for "carrot", then check a cell in that "carrot" row for the year "2021", and then return string "new vegetable" if all of these conditions are met, and "old vegetable" if not.

How would I best accomplish this?

​

The goal being searching A:A for "carrot", then searching C:C from that row for "2021". If both conditions are TRUE, we return string "new vegetable".

ABC
CeleryTom1999
CarrotMegan2021
TomatoAlex2019

​

If not both of these conditions are TRUE, we return string "old vegetable".

ABC
CeleryTom1999
CarrotMegan2019
TomatoAlex2019

​

Posted May 18, 2021, 5:25 AM UTC · edited

14
AutoModeratorMOD•

Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. Thank you.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1
BarneField3•

Look into combining INDEX() and MATCH() like, for example, so:

=IF(INDEX(C:C,MATCH("Carrot",A:A,0))=2021,"new","old")

Or keep using VLOOKUP():

=IF(VLOOKUP("Carrot",A:C,3,FALSE)=2,021,"New","Old")

Note, both options return an error if "Carrot" don't exist at all in A:A. Therefor you may want to nest the above inside IFERROR().

1
dcburnquistOP•

Excellent. Haven't tried it yet but sounds familiar. I was getting a bit foggy and nee fed some outside eyes. I'll test this tomorrow, but seems like it should do the trick.

1
Decronym:assistant: Functions Explained•

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

|Fewer Letters|More Letters| |-------|---------|---| |FALSE|Returns the logical value FALSE| |IF|Returns one value if a logical expression is TRUE and another if it is FALSE| |INDEX|Returns the content of a cell, specified by row and column offset| |MATCH|Returns the relative position of an item in a range that matches a specified value| |TRUE|Returns the logical value TRUE|


^([Thread #2957 for this sub, first seen 18th May 2021, 06:51]) ^[FAQ] ^([Full list]) ^[Contact] ^([Source code])

1