If Then Else Statement .... Help

KillerDragonKC

New Member
Joined
Sep 9, 2015
Messages
20
I believe what I am looking for is a proper If Then Else statement to put into my current VBA code.

What I have is Numerical values in Column H, of which the only 2 I am concerned with is 220 or 221.

*If the value in the cell of Column H is 220 then the formula =IF(AND(L2>(365-(Import!$E$3-TODAY())), L2<365),"YES","NO"), would need to be the result.
-----Basically what I have is the end of the current month in cell E3 of the Import Tab. The formula tells me if the current line is going to cross the 365 day threshold by the end of this month. If it is then the result would be YES

*If the value in the cell of Column H is 221 then the formula =IF(AND(L2>(90-(Import!$E$3-TODAY())), L2<90),"YES","NO"), would need to be the result.
Same scenario as the 220 only in this case I am determining if the line will cross the 90 day threshold by the end of this month.

*All other values in Column H would need to be answered with a NO.


I have, with the help of this forum, been able to get the script setup to import my text file and get me to this point. I am just stumped at this crossroad.

I have researched and come up with nothing that I can modify to work in my favor. I hope one of the many guru's on this forum can direct me to a solution.

Thank you ahead of time for any assistance you can provide.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

ukmikeb

Well-known Member
Joined
Jul 10, 2009
Messages
2,757
Hi

Try :-
Code:
=IFERROR(IF(AND(L2 > (INDEX({365,90},MATCH(H2,{220,221},0))-(Import!$E$3-TODAY())), L2 < INDEX({365,90},match(h2,{220,221},0))),"yes","no"),"no")

assuming H2 is the starting cell.

hth
 

KillerDragonKC

New Member
Joined
Sep 9, 2015
Messages
20
That is perfect. Works like a charm. Now I can move on to the other tasks I need to get this sheet to do. I really appreciate your help.:)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,480
Messages
5,770,341
Members
425,612
Latest member
martinijr

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
Top