Excel Equation Help!

ruawzrd

New Member
Joined
Apr 9, 2019
Messages
3
[FONT=&quot]How do I write an equation in excel that has the following format:[/FONT]
[FONT=&quot]
[/FONT]

[FONT=&quot]IF "C3 is found anywhere in Column H"
then IF "D4 is equal to either Column I or J (on the same row as where C3 was found in Column H)"[/FONT]

[FONT=&quot]then "Pass", Else "Fail"[/FONT]
[FONT=&quot]
[/FONT]

[FONT=&quot]this will be continued for the rows, e.g. search for C4 anywhere in column H, and match D5 to either column I/J on same row that C4 was found in column H).. and so forth [/FONT]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Is this what you need

Code:
=IF(COUNTIF(H:H,C3)>0,"Pass",IF(COUNTIF(I:J,D4)>0,"Pass","Fail"))
 
Upvote 0
Bit shorter

Code:
=IF(OR(COUNTIF(H:H,C3)>0,COUNTIF(I:J,D4)>0),"Pass","Fail")
 
Last edited:
Upvote 0
Thank you! However this code seems to search the entire I and J column.

I need it to first find C3 anywhere in COLUMN H.
If it finds it for example at H10, then it needs to check if D4 equals to either I10 or J10 (not the entire column)

You also have an OR statement at the beginning, but should it be AND instead? Since IF C3 is found in Column H, THEN (and) D4 is found on that same row in column I or J, then pass
 
Upvote 0
Ok, I see your issue.....will have to give that more thought...someone else may jump in in the meantime!
 
Upvote 0
Maybe...

=IF(ISNUMBER(MATCH(D4,INDEX(I:J,MATCH(C3,H:H,0),0),0)),"Pass","Fail")

M.
 
Upvote 0

Forum statistics

Threads
1,223,933
Messages
6,175,471
Members
452,646
Latest member
tudou

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