Need help to write formula in Excel

Hi,
 We have two colun in my excel. 1. Amt1 , Amt2 and i need to come up with "Output calculate column with following criteria.

if “Amt1” is 1.50 or less and “Amt2” is 2:00 or less, “Output” is “Yes.”
If “Amt1” is 1.50 or less and “Amt2” is greater than 2:00, “Output” is “No.”
If “Amt1” is greater than 1.50 and “Amt2” is 4:00 or less, “Output” is “Yes.”
If “Amt1” is greater than 1.50 and “Amt2” is greater than 4:00, “Output” is “No.”

Can you please help?
sharepoint0520Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlanConsultantCommented:
Hi,

If Amt1 is in Column A, and Amt2 is in column B, then you could try something like this:

=IF(AND(A1<=1.5,B1<=2),"Yes",IF(AND(A1<=1.5,B1>2),"No",IF(AND(A1>1.5,B1<=4),"Yes",No")))


Adjust the column letters and row numbers to suit your actual data.

Alan.
Ryan ChongSoftware Team LeadCommented:
I would use Alan's formula and revised to this instead:

=IF(AND(A2<=1.5,B2<=TIME(2,0,0)),"Yes",IF(AND(A2<=1.5,B2>TIME(2,0,0)),"No",IF(AND(A2>1.5,B2<=TIME(4,0,0)),"Yes","No")))

Open in new window

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Amt2 column contains number or a time value?

If Amt2 is number...
=IF(OR(A2="",B2=""),"",IF(A1<=1.5,IF(B2<=2,"Yes","No"),IF(B2<=4,"Yes","No")))

Open in new window


If Amt2 is time...
=IF(OR(A2="",B2=""),"",IF(A2<=1.5,IF(B2<=TIME(2,0,0),"Yes","No"),IF(B2<=TIME(4,0,0),"Yes","No")))

Open in new window

Price Your IT Services for Profit

Managed service contracts are great - when they're making you money. Yes, you’re getting paid monthly, but is it actually profitable? Learn to calculate your hourly overhead burden so you can master your IT services pricing strategy.

Rob HensonFinance AnalystCommented:
Your Amt1 doesn't seem to have any impact on the result, only the Amt2 changes the result.

      02:00      04:00
1.5      Yes            No
10      Yes            No

So you only need to test the value of Amt2:

=IF(B2<=TIME(2,0,0),"Yes","No")
sharepoint0520Author Commented:
Thank you all for quick support. I apologies for requirement change. The amt2 is the calculate  hour column from Start Date and End Date. Can you please help me to write one formula to accomplish this?

Thank you.
Calculate-Column.xlsx
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Try this...

In F2
=IF(OR(C2="",D2="",E2=""),"",IF(C2<=1.5,IF(E2-D2<=TIME(2,0,0),"Yes","No"),IF(E2-D2<=TIME(4,0,0),"Yes","No")))

Open in new window


OR using table structured reference...
In F2
=IF(OR([@Amt1]="",[@[Date/_Start]]="",[@[Date_End]]=""),"",IF([@Amt1]<=1.5,IF([@[Date_End]]-[@[Date/_Start]]<=TIME(2,0,0),"Yes","No"),IF([@[Date_End]]-[@[Date/_Start]]<=TIME(4,0,0),"Yes","No")))

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sharepoint0520Author Commented:
Thank you Neeraj and Thank you all for your help.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.