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

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
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
 
Upvote 0
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.:)
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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