If else with criteria

nicci113

New Member
Joined
Sep 29, 2012
Messages
19
Hi There,

I'm stuck with a simple if else query and need a bit of guidance.

what I'm trying to do is compare 2 dates based on the condtion from different cell and if condition gets statisfy put pass else put fail..

Can you please guide me? I know its not that difficult i just need a bit of heads up.

thanks
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
You need to provide a bit more info.
What are the cell references?
What is the condition?
 
Upvote 0
if b2="1) E02 emergency", then Colmn e-colmn D Else, Column D- C and diplay the result as pass or fail#

<colgroup><col width="104"></colgroup><tbody>
</tbody>

I hope it help, I don't get option to upload the document. below is the sample data, what I need is where priority desc is "emergency" calc action complete - target date else and display the result as pass or fail..


priority descriptiontarget dateaction completedat site timestamp
1) E02 Emergency01/08/2014 07:2301/08/2014 11:5401/08/2014 11:22
5) R20 Routine01/09/2014 08:2911/08/2014 15:00

<colgroup><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0
If you do "Colmn e-colmn D Else, Column D- C", how do you know if it is Pass or Fail?
 
Upvote 0
those columns are dates, so if the earlier date is lesser the latar its a fail else pass.

OK you originally said "calc action complete minus target date"!

Try

=IF(B2="1) E02 Emergency",IF(D2<=C2,"Pass","Fail"),"")
 
Upvote 0
OK you originally said "calc action complete minus target date"!

Try

=IF(B2="1) E02 Emergency",IF(D2<=C2,"Pass","Fail"),"")


cheers mate it does work, could you please give me a syntax if I want to add condition to it where it doesnt equal to which i think is <> but doesn that if statement goes withiin "" you have entered in teh end?

Apperciate your help!
 
Upvote 0
You're welcome, it depends on how you want to check for <>? It could be

=IF(B2="1) E02 Emergency",IF(D2<=C2,"Pass",IF(??<>??,??,"Fail")))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,653
Messages
6,131,940
Members
449,688
Latest member
AKEBOAG

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