# IF AND statement or Vlookup or a Macro not sure which to use.

1. ## IF AND statement or Vlookup or a Macro not sure which to use.

Excel Test Help1.xlsxIf "item" in sheet2 matches "item' in sheet1 and "color' in sheet2 matches "color' on sheet one then return the number next to it. If it doesn't then move to the next one basically.

2. ## Re: IF AND statement or Vlookup or a Macro not sure which to use.

Try this formula (you may have to adjust the cell references a bit):

=IF(AND(B6=Florals!B2,E6=Florals!C4),Florals!E3,"")

It will return the total number in Sheet 1 if they match, and leave it blank if they don't.

3. ## Re: IF AND statement or Vlookup or a Macro not sure which to use.

It works, THANKS!
but
I need it to work on all of them. I think just needs a lot of nested. I'm gonna try to figure out the nested to get it from here if not ill post help.

4. ## Re: IF AND statement or Vlookup or a Macro not sure which to use.

What helps me to visualize nested functions is to think of it as a road with many forks. The IF function goes like this:

IF *this* is true, then do *that* (go down the left fork), and if it is false, do *something else* (go down the right fork).

Putting the following function in cell B1 : IF(A1=7,"HELLO!","GOODBYE!") If A1 = 7, then we go down the left fork which leads us to the text HELLO! or if A1 <> (doesn't equal) 7, then we go down the right fork to the text GOODBYE!

IF(A1=7,"HELLO!",IF(AND(C2>5,A1<4),"SUPER!","GOODBYE!"))

Here, if A1 = 7 we take the left fork to "HELLO!" and if A <> 7, we take the right fork, which now leads us to another set of forks. At this fork, if C2>5 and A1<4, we take the left fork to SUPER! and if not, we take the right fork to

5. ## Re: IF AND statement or Vlookup or a Macro not sure which to use.

PL see attached file with array formula.

6. ## Re: IF AND statement or Vlookup or a Macro not sure which to use.

Great explanation. I got the whole thing to work! Thank you so much!

How to mark as solved. lol

7. ## Re: IF AND statement or Vlookup or a Macro not sure which to use.

Thanks for the compliment.
I have changed formula slightly so that if column C is blank it will give blank result.slight improvement.
To mark the thread solved at the top go to "Thread tools".
``Please Login or Register  to view this content.``

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1