Multiple IF statements together

amattey

New Member
Joined
Jul 18, 2011
Messages
46
Hello,

I am trying to get a formula where if a cell has a x or y, to say "DO ON" &the value on the cell next to the one that contains only the X, otherwise to say "DO NOT DO". Below if what I though the formula would look like but when I type it in gives me an error. Could anyone help?

=IF(B2="x","Do on "&A2),IF(B2="y","Do on "&VLOOKUP("x",A2:E110,4,FALSE),"Do not do")
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
You have a misplaced closing parenthesis:

=IF(B2="x","Do on "&A2,IF(B2="y","Do on "&VLOOKUP("x",A2:E110,4,FALSE),"Do not do"))
 
Upvote 0
I corrected the mistake but it only meets the first condition, the second IF condition does not work. Shows a Value error.
 
Upvote 0
There might be an issue with your VLOOKUP.... which is attempting to lookup "x", and thus will always return the same value. I'm guessing there is no "x" in A2:E110... and you're probably getting a #N/A.

Do you truely mean to lookup "x", or is there another variable you're looking for?
 
Upvote 0
Yes, I am trying is to recognize that if a cell is 2 years over a date or one year under the same date it will say DO on the date. Maybe anyone can help me with an easy way to do so. My VLOOKUP was not working properly because I had too many Xs
 
Upvote 0
Is the date you're comparing against a constant, or a variable? In other words, are you trying to compare all records vs 07/28/2011 (or another specific date)

or are you trying to compare them agianst some other variable date in another column?
 
Upvote 0
I have a task that is suppose to be done every 6 years starting 2010, however, if a job is due on 2009, 2011, or 2012, I want it to be done in 2010 so they do not go overdue. Of course each cell will vary as the next statement will compare the task due on 2016 against the jobs due near that date.
 
Upvote 0
I have a task that is suppose to be done every 6 years starting 2010, however, if a job is due on 2009, 2011, or 2012, I want it to be done in 2010 so they do not go overdue. Of course each cell will vary as the next statement will compare the task due on 2016 against the jobs due near that date.


So...
Column "A" is a task identifier
Column "B" is a due date

and you want column C to say:

If the due date is > ("a certain time" + 2 Years), then read "Do On...."
If noth, then if the due date is < (a certain time" - 1 Year), then read "Do On..."
and if neither of those, then read "Do not due"

Something like that?

If so, please define "a certain time" as well as what you want the "..." to be after "Do On"

If not... maybe try explaining what you've got (in what columns) and what result you want.
 
Upvote 0
Yes you got it right.

Column A in sheet 1 tells me the due date for the job.
Column B in sheet 2, tells me when are the tasks years date.

I want column C in sheet 1 to say:
that If A1 is +2 years of the date in B1 (sheet 2) then do in that due task year. and If A1 is -1 years of date in B1 (sheet 2), then do in year shown in B1.

The words i want to show are "Do on "&B1, or "Do as Routine"
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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