Using If statement in cell based on two adjacent cells

zoog25

Active Member
Joined
Nov 21, 2011
Messages
418
Hello All,

Here is a question, I have a situation where i have a column "AD" that displays a date. The date listed should be 1 year from the date shown in column "AC", unless "N/A" is noted, then it should list the date for 1 year from column "AB". I really familiar with vba but i don't want to make a complicated coding for something i now i can just do a formula to feed into column AD.

Can someone please show me what i need to do in order to write a proper If statement for this situation.

Thank you.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hey assuming you are using row 1 to start with:

AD1:
Code:
=IF(AC1="N/A",EDATE(AB1,12),EDATE(AC1,12))
 
Upvote 0
Slightly shorter version...
=EDATE(IFERROR(AC1,AB1),12)

Nice! Although it would depend if AC1 is actually an error or just the string "N/A" - if it's just a string then this formula returns an error in itself.
 
Upvote 0
Thanks everyone, i'm trying each one out but so far they are all working. Thank you once again.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

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