Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

If two values in a row match a criteria then show the value of a cell in that row

0

I have a sheet with rows of data and I want to say if the information in column C matches a cell in a different sheet and the information in column G >0 show the what that row says in column A.

I've tried the below but they all come back as False

=IF(AND(sheet1!C:C,sheet2!D2,sheet1!G:G>0),sheet1!A:A)

I'm trying to do this in sheet2. 

Thanks 

Answer
Discuss

Answers

0

You will know that the IF function needs (Decision, value if True, value if False).

The decision bit doesn't work on entire columns (e.g. you have C:C and G:G) but will work on single cells. Try this in Row 2 (say) or change the numbers in bold if a different row:

=IF(AND(Sheet1!C2=Sheet2!D2,Sheet1!G2>0),Sheet1!A2,"Your message")

If that works (and you change or remove the Value if False bit), you should be able to copy that cell down to other rows.

Hope this helps. If so, please Select this answer.

Discuss

Discussion

Congratulations @John_Ru, you got your name on the honours list. It's a pleasure working with you.
Variatus (rep: 4889) Nov 16, '20 at 8:35 pm
Likewise @Variatus but I'm humbled by your towering position which must reflect years of providing your vast knowledge to help others. Amazing, 😁
John_Ru (rep: 6102) Nov 17, '20 at 1:17 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login