?
Solved

can a VLookup include "Exclude roll forward if weekend dates returned"

Posted on 2014-09-25
10
Medium Priority
?
223 Views
Last Modified: 2014-09-25
Can an expert resolve this for me.

I am using a VLookup i.e.:

=IF(ISERROR(VLOOKUP(A2,Nov!D:I,6,0)),"",(VLOOKUP(A2,Nov!D:I,6,0)))

But if the date it returns is a weekend I need it to to be rolled forward to the next working day i.e. Monday

so if the date it returns is 27/9/14 I need it to change to 29/9/14

if the date it returns is 28/9/14 I need it to change to 29/9/14

Is this possible

Thanks
0
Comment
Question by:Jagwarman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 2000 total points
ID: 40343463
Assuming you have Excel 2007 or greater, you can use IFERROR(A1,""), instead of IF(ISERROR(A1),"",A1) - it's quicker.

Here's the answer:

=IFERROR(VLOOKUP(A2,Nov!D:I,6,0)+CHOOSE(WEEKDAY(VLOOKUP(A2,Nov!D:I,6,0),1),1,0,0,0,0,0,2),"")

Open in new window

0
 

Author Comment

by:Jagwarman
ID: 40343468
wow that was a fast reply. Brilliant I would never have worked that out thanks Phillip
0
 

Author Closing Comment

by:Jagwarman
ID: 40343471
Very helpfull Expert.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Jagwarman
ID: 40343904
Phillip,

sorry to trouble you again on this one but, when the VLookup does it's work, if the field it looks up is blank it is returning 02/01/1900

I thought that IFERROR would stop that?

Thanks & Regards
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40343908
No, "IFERROR" or "IF(ISERROR" will only return a blank if there is an error.

If column I is nullable, then VLOOKUP will return a zero (instead of a blank value), and you need to check for it:

=IFERROR(if(VLOOKUP(A2,Nov!D:I,6,0)=0,"",VLOOKUP(A2,Nov!D:I,6,0)+CHOOSE(WEEKDAY(VLOOKUP(A2,Nov!D:I,6,0),1),1,0,0,0,0,0,2)),"")

Open in new window

0
 

Author Comment

by:Jagwarman
ID: 40343948
sorry I have another problem now

The date it is looking up is 17/11/2014 which is a Monday but it is returning 19/11/2014

Would you know why?
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40343955
It isn't for me. Are you sure that there isn't an earlier version of the thing that it is looking up, which has an earlier date?
0
 

Author Comment

by:Jagwarman
ID: 40343974
this is going to be one of those bizzare things. I have played around with the dates but can't resolve
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40343977
Do you want to post your spreadsheet, or is it confidential?
0
 

Author Comment

by:Jagwarman
ID: 40344003
it was me, sorry and BIG thanks for your help

instead of D:I,6,0   D:I,6,0   D:I,6,0

I somehow put

D:I,6,0   D:I,6,0   D:I,7,0
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

752 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