Help with IF Statement

odonovanc

New Member
Joined
Oct 4, 2017
Messages
46
I have the following formula and I want to add to it:

=IFERROR(IF(AND(P3="N",vlookup(C3,data!$A$3:$J$16,8,false)>0),(D3-vlookup(C3,data!$A$3:$M$16,8,false)),""),"")

I want all that functionality to stay the same if P3 is a N, but I want to add that if P3 = "Y" then it will return one day later the date in Q3 (So if Q3 was 3/4/2021, it will return 3/5/2021) instead.

Can someone help?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
6,007
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Just add to your IF statement:

Excel Formula:
=IFERROR(IF(AND(P3="N",VLOOKUP(C3,data!$A$3:$J$16,8,FALSE)>0),D3-VLOOKUP(C3,data!$A$3:$M$16,8,FALSE),IF(P3="Y",Q3+1,"")),"")
 

Watch MrExcel Video

Forum statistics

Threads
1,130,314
Messages
5,641,480
Members
417,210
Latest member
rins

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