Solved

VLookup then calculate

Posted on 2014-02-06
11
247 Views
Last Modified: 2014-02-06
Could an expert provide me with the formula to do a Vlookup then perform a calculation.

Assume we start on Sheet1 on "E2"
i.e. Vlookup the Ref in A2 [Sheet1] on sheet3 column 'A', if it is there in Sheet3 find the number in column 'C' and then increase the date in Sheet1 by that number of months.

So. If my date in Sheet1 is 14/3/2014 and the number in Sheet 3 is 4 put 14/7/2014 in column 'C' in Sheet1

So. If my date in Sheet1 is 14/3/2014 and the number in Sheet 3 is 12 put 14/7/2015 in column 'C' in Sheet1

Hope this is clear.
Thanks
0
Comment
Question by:Jagwarman
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 39838232
Hi,

pls use

=EDATE(E2,Sheet3!A2)

Open in new window

E2 is your date in Sheet 1 and the amount of Months in sheet3

Regards
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 39838252
you can use this formula
=DATE(YEAR(E3);MONTH(E3)+VLOOKUP(E3;Sheet3!$A$1:$C$4;3;FALSE);DAY(E3))

or

=EDATE(E2;VLOOKUP(E3;Sheet3!$A$1:$C$4;3;FALSE))

check in my sample as well
sample.xlsx
0
 

Author Comment

by:Jagwarman
ID: 39838265
Thanks for the replies which I will look at however, I have just been informed that the user is looking for something even more complicated. I have attached a file to explain. They are looking for me to include :

If date 1 is weekend populate last working day.
If date 2 is weekend populate next working day

Regards
NextDates.xlsx
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Jagwarman
ID: 39838275
Rgonzo1971 from what I can make out with your formula, it does not take into account the Ref it needs to look up in Sheet1
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 39838281
yes, Rgonzo forgot to implement lookup formula (VLOOKUP) into his calculation.

Also question is if dates in Sheet3 are unique. BEcause if not and you have the same date in row 2 and in row 10 (because its the same date but for diferent employee) VLOOKUP formala wont work (OK, it will be but always takes a C value from the 1st date it finds, so from row 2)
0
 
LVL 29

Expert Comment

by:gowflow
ID: 39838305
Is this what you want ?
gowflow
NextDates.xlsx
0
 

Author Comment

by:Jagwarman
ID: 39838333
Hi Gowflow. thanks but not quite.

I need to lookup the frequencyin Sheet3 and populate in sheet1 against its respective Ref.

So I lookup 6290614 [A2 in Sheet1] see if that is in sheet 3 find the frequncy and put this in Sheet 1 column D. [I can do this as it's an easy Vlookup]

i.e. [I have used row 12 from the spreadsheet as it is better to show the detail]
Ref      Date1                          Date2            Frequency
25922383      24/01/2014      25/01/2014      12


Then perform the second part of the formula. I now need to increase Date 1 and Date 2 by the frequency taking into account

If date 1 is weekend populate last working day.
If date 2 is weekend populate next working day

so:

Ref      Date1          Date2            Frequency        NextDate1                  NextDate2

25922383      24/01/2014  25/01/2014      12      23/01/2015      25/01/2015

Regards
0
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39838388
Hi,

Shouldn't be the NextDate2 26.1.2015 Monday after the W-E

See example
NextDatesV1.xlsx
0
 

Author Comment

by:Jagwarman
ID: 39838423
Rgonzo1971 yes you are correct
0
 

Author Closing Comment

by:Jagwarman
ID: 39838450
Thanks
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 39838542
HI,

The same sheet with smaller formulas

Regards
NextDatesV2.xlsx
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question