Edate & if?

Gwill1983

Board Regular
Joined
Oct 24, 2018
Messages
124
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am newly registered on the forum, but have been using it to solve my problems for a long time now. I haven't been able to find a solution to my problem on this occasion however.

I have a spreadsheet whereby I need to add a certain number of months onto the quotation validity period. I have been doing this using EDATE successfully so far. I now need to adjust this formula to add a certain number of months depending which manufacturer the quotation is from as they all have different validity periods..... I am now struggling!

My spreadsheet currently has the quotation date in column H named Opening Date and my formula in column I is =EDATE([@[Opening Date]],6). I now want to amend this formula to take into account which manufacturer is selected in column D.

If there is anybody who can help then that would be great as I have run out of ideas.

Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
A couple of examples would be useful.

A quick guess follows.



Excel 2010
BCDEFG
1ManufacturerMonths
220-Oct-1820-Feb-19CBCABC6
3CBC4
4DDD8
5
1d
Cell Formulas
RangeFormula
C2=EDATE(B2,VLOOKUP(D2,$F$2:$G$4,2))
 
Upvote 0
Apologies! Your quick guess was absolutely spot on!

This worked a dream. I have added a seperate tab so that I can add manufacturers going forward.

Thanks for your help!
 
Upvote 0
Hi,
I have just noticed that this hasn't worked quite as brilliantly as I thought.

I have used your suggestion of a separate table with the manufacturers as below:

A B
1 MANUFACTURER MONTHS
2 AB 6
3 AC 6
4 AD 1
5 AE 1
6 AF 1
7 AG 1

The formula that you gave me works on AB, AC & AF, but the others return an #NA .

I have attempt to re-jig the formula to make it work, but I cannot find a work around.

Any ideas what might be causing this?

Chris
 
Upvote 0
Did you remember to lock down your lookup range reference with the absolute range reference signs ($)?

Please post your formula for us to see.
 
Upvote 0
The formula that I have used is:

=EDATE(H3,VLOOKUP(D3,Manufacturers!$A$2:$B$10,2))

H3 is the opening date for the quotation
D3 is cell where I enter the manufacturer
I have a seperate tab for the table that I tried to put in as an example which has the list of manufacturers in column A and the validity period in months in column B
 
Upvote 0
That would seem to suggest that you actually do not have a match via the VLOOKUP formula.
Note that D3 must EXACTLY match a value in column A on the Manufacturers sheet. If there are ANY differences (like an extra space at the end of D3 or the entry in column A), they will NOT match.

My suggestion is to investigate an apparent match that isn't working.
Check the length of both entries, and see if they really match.
 
Upvote 0
Add 0 or False to the Vlookup for exact match

=EDATE(H3,VLOOKUP(D3,$A$2:$B$10,2,0))

=EDATE(H3,VLOOKUP(D3,Manufacturers!$A$2:$B$10,2,0))
 
Upvote 0
Brilliant!

This fixed it. Thanks so much for everyones help.

I am sure it will not be my last question!
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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