If condition help

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,284
Office Version
  1. 365
Platform
  1. Windows
Hi All,

after longtime on board..

I need one help in formula. date mm/dd/yyyy

Excel Formula:
=IF(AND(O1="ML",C1>=8/5/2023) then inner IF formulation should work (i.e. 1st iteration) else if any one condition not true then perform other IF formulation  i.e. (2nd iteration)

How do I achieve the same. Now with my current formula, what happens is, if ML is with less that 8th May date even then it work 1st iteration. Ideally it should give me what return in 2nd iteration. Pls guide..

Infact, even if my Col O and Col C have different values it is giving me False as o/p.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
=IF(AND(O1="ML",C1>= DATE(2023,8,5)), OPERATION WHEN 1ST CONDITION TRUE,
IF(2ND CONDITION TO CHECK,​
OPERATION when 2ND CONDITION IS TRUE,​
OPERATION WHEN ALL CONDITIONS BOTH FALSE))​
I'm not sure if that is what you're asking for or not.
 
Upvote 0
Hi, Thanks for your reply..
I'm posting my actual formula. Col C is date column.
Excel Formula:
This is main condition..
=IF(AND(O73580="ML",C73580>=8/5/2023),

if the above condition true then perform below till "week 27 onwards"..
IF(G73580="","",
IF(I73580<=5,"Week 1",
IF(AND(I73580>5,I73580<=10),"Week 2",
IF(AND(I73580>10,I73580<=20),"Week 3 & 4",
IF(AND(I73580>20,I73580<=30),"Week 5 & 6",
IF(AND(I73580>30,I73580<=40),"Week 7 & 8",
IF(AND(I73580>40,I73580<=50),"Week 9 & 10",
IF(AND(I73580>50,I73580<=60),"Week 11 & 12",
IF(AND(I73580>60,I73580<=70),"Week 13 & 14",
IF(AND(I73580>70,I73580<=80),"Week 15 & 16",
IF(AND(I73580>80,I73580<=85),"Week 17",
IF(AND(I73580>85,I73580<=100),"Week 18 & 20",
IF(AND(I73580>100,I73580<=115),"Week 21 & 23",
IF(AND(I73580>115,I73580<=130),"Week 24 & 26",
IF(I73580>130,"Week 27 onwards",

else, if any one condition not true then perform below one..
IF(G73580="","",
IF(I73580<=5,"Week 1",
IF(AND(I73580>5,I73580<=10),"Week 2",
IF(AND(I73580>10,I73580<=20),"Week 3 & 4",
IF(AND(I73580>20,I73580<=30),"Week 5 & 6",
IF(AND(I73580>30,I73580<=40),"Week 7 & 8",
IF(AND(I73580>40,I73580<=50),"Week 9 & 10",
IF(AND(I73580>50,I73580<=60),"Week 11 & 12",
IF(AND(I73580>60,I73580<=70),"Week 13 & 14",
IF(AND(I73580>70,I73580<=80),"Week 15 & 16","FTE"))))))))))))))))))))))))))

Is it possible? Pls guide..
 
Upvote 0
Is this excel or VBA? It looks like it is VBA, but you've got it wrapped in the "Excel" html block.
why don't you post your actual formula if it is excel? And, if excel you can also post the worksheet as a mini worksheet using the xl2bb add in (Link below).

If it is vba, please post your actual code in a vba block
 
Upvote 0
Is this excel or VBA? It looks like it is VBA, but you've got it wrapped in the "Excel" html block.
why don't you post your actual formula if it is excel? And, if excel you can also post the worksheet as a mini worksheet using the xl2bb add in (Link below).

If it is vba, please post your actual code in a vba block
This is excel formula. This is directly from cell I've pasted here
 
Upvote 0
This is my previous formula.
Excel Formula:
IF(G73580="","",
IF(I73580<=5,"Week 1",
IF(AND(I73580>5,I73580<=10),"Week 2",
IF(AND(I73580>10,I73580<=20),"Week 3 & 4",
IF(AND(I73580>20,I73580<=30),"Week 5 & 6",
IF(AND(I73580>30,I73580<=40),"Week 7 & 8",
IF(AND(I73580>40,I73580<=50),"Week 9 & 10",
IF(AND(I73580>50,I73580<=60),"Week 11 & 12",
IF(AND(I73580>60,I73580<=70),"Week 13 & 14",
IF(AND(I73580>70,I73580<=80),"Week 15 & 16","FTE"))))))))))))))))))))))))))

but since I got requirement that, if employee from ML team and after 8th May date then the above mentioned 1st iteration should work else this is the one previous..
 
Upvote 0
Try it like
Excel Formula:
=IF(AND(O73580="ML",C73580>=DATE(2023,5,8)),
 
Upvote 0
hi, a somewhat more complex formula, but it appears to solve the problem:

Excel Formula:
=IF(G75380="","",
CHOOSE(IF(AND(O73580="ML",C73580>=DATEVALUE("8/5/2023")), INT(I73580/5.001)+1, IF(INT(I73580/5.001)+1>16,28,INT(I73580/5.001) +1)),
"Week 1","Week 2", "Week 3 & 4", "Week 3 & 4", "Week 5 & 6", "Week 5 & 6", "Week 7 & 8", "Week 7 & 8", "Week 9 & 10", "Week 9 & 10", "Week 11 & 12", "Week 11 & 12","Week 13 & 14", "Week 13 & 14","Week 15 & 16", "Week 15 & 16","Week 17", "Week 18 & 20","Week 18 & 20", "Week 18 & 20","Week 21 & 23", "Week 21 & 23","Week 21 & 23", "Week 24 & 26","Week 24 & 26", "Week 24 & 26","Week 27 Onwards","FTE"))

The criteria elements are in the first part of the formula and the latter is simply a list of the responses.

HTH
 
Upvote 0
In that case please post some sample data, along with the formula you are using that shows the problem.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

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