If using and for Multiple Conditions

DHAM1963

New Member
Joined
Jan 25, 2022
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Using 365. Hello and thank you in advance for any help. I want to put some data from Source table into Entry table based on 2 conditions. I haven't been able to get it to work and I wonder if that is because 1 piece of criteria is in a row and one is in a column. What I want to do (IF Date in Entry Table Column A is found in Source column A AND if Entry Table C1 is found in Source Column B then put Source C2)
=IF(AND(A2=Source!A:A,C1=Source!B:B),C2,"missing") did not work
 

Attachments

  • Entry Table.jpg
    Entry Table.jpg
    24 KB · Views: 6
  • Source.jpg
    Source.jpg
    22.6 KB · Views: 6

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
That is correct. You cannot check to see if a single cell is equal to a whole column. That does not make any sense.
But you can check to see if it exists in the column. One way is to use COUNTIF to count how many times it appears in the column, i.e.
Excel Formula:
=IF(AND(COUNTIF(Source!A:A,A2)>0,COUNTIF(Source!B:B,C1)>0),C2,"missing")

If they MUST appear on the same line/row, then you can just use COUNTIFS, i.e.
Excel Formula:
=IF(COUNTIFS(Source!A:A,A2,Source!B:B,C1)>0,C2,"missing")
 
Upvote 0
Using 365. Hello and thank you in advance for any help. I want to put some data from Source table into Entry table based on 2 conditions. I haven't been able to get it to work and I wonder if that is because 1 piece of criteria is in a row and one is in a column. What I want to do (IF Date in Entry Table Column A is found in Source column A AND if Entry Table C1 is found in Source Column B then put Source C2)
=IF(AND(A2=Source!A:A,C1=Source!B:B),C2,"missing") did not work

That did not work for me, this might clarify things, I have 2 working formulas for looking up the data but what i Need to do is combine them, so if both things are true put a value or reference

=IF(ISNUMBER(MATCH(C1,Source!B:B,0)),1,0)

=IF(ISNUMBER(MATCH(A2,Source!A:A,0)),1,0)
 
Upvote 0
Using 365. Hello and thank you in advance for any help. I want to put some data from Source table into Entry table based on 2 conditions. I haven't been able to get it to work and I wonder if that is because 1 piece of criteria is in a row and one is in a column. What I want to do (IF Date in Entry Table Column A is found in Source column A AND if Entry Table C1 is found in Source Column B then put Source C2)
=IF(AND(A2=Source!A:A,C1=Source!B:B),C2,"missing") did not work
These are 2 working formulas looking up the data in question, what I want to do is combine them into one formula so it both things are true it displays a value or reference

=IF(ISNUMBER(MATCH(C1,Source!B:B,0)),1,0)

=IF(ISNUMBER(MATCH(A2,Source!A:A,0)),1,0)
 
Upvote 0
You mean like this?
Excel Formula:
=IF(AND(ISNUMBER(MATCH(C1,Source!B:B,0)),ISNUMBER(MATCH(A2,Source!A:A,0))),1,0)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top