Spy Journal 3.0 - VLOOKUP
https://www.spyjournal.biz/taxonomy/term/310/0
enRound up of Excel Tips and Hints
https://www.spyjournal.biz/round-excel-tips-and-hints
<p>As Office 2010 becomes more prevalent in the workplace (most of our clients either have or will be soon updating to it) so the use of the ribbon has become more natural and intuitive for people. It is certainly much more intuitive than the old menu driven interface.</p>
<p><a href="http://www.spyjournal.biz/files/rh2-150x150.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="rh2-150x150" border="0" alt="rh2-150x150" align="right" src="http://www.spyjournal.biz/files/rh2-150x150_thumb.png" width="154" height="154" /></a>Play a fun game called <a href="http://blogs.office.com/b/microsoft-excel/archive/2011/06/07/build-excel-smarts-with-ribbon-hero-2.aspx">Ribbon Hero 2</a> that allows you to learn the fastest and best ways to do various common tasks in the various Office Apps. My kids are using this to learn the interface and some of these common tasks. I have even learnt some things in the 5 minutes I have spent playing it so far! <a href="http://www.ribbonhero.com/">Download Ribbon Hero 2</a>.</p>
<p><a href="http://blogs.office.com/b/microsoft-excel/archive/2011/05/10/take-the-first-step-in-growing-your-excel-skills.aspx">Take the first step in growing your Excel Skills</a>. Microsoft have created a series of learning videos that assist new users to Excel to grow their skills</p>
<p><a href="http://blogs.office.com/b/microsoft-excel/archive/2011/06/01/learn-how-to-create-your-own-excel-macros-in-this-free-training-course.aspx">Learn how to create your own Excel Macros with a free training course</a>. Ideal for the entry level person who wants to explore macro writing for the first time. Note this doesn't create efficient code, but its a start to understanding how the VBA code interacts with Excel.</p>
<p><a href="http://blogs.office.com/b/microsoft-excel/archive/2011/05/24/getting-started-with-powerpivot-for-excel.aspx">PowerPivot for Excel</a> - if you have looked or used <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e081c894-e4ab-42df-8c87-4b99c1f3c49b&displaylang=en">PowerPivot</a> (See my <a href="http://www.spyjournal.biz/node/1197">review of Power Pivot</a>) than this page has some good links for additional resources.</p>
<!--break--><!--break--><h3>Ribbon</h3>
<p>The ribbon is also extensible via code and can be added to or modified as required for specific applications and requirements.</p>
<p><a href="http://www.dailydoseofexcel.com/archives/2011/06/07/enable-or-disable-custom-ribbon-buttons-in-excel-2007-2010/">Enable or Disable Custom Ribbon Buttons in Excel 2007-2010</a>. Links from Ron to his site where he shows how to work with the ribbon in VBA.</p>
<p><a href="http://blogs.office.com/b/microsoft-excel/archive/2011/05/19/avoid-losing-the-state-of-the-global-iribbonui-ribbon-object.aspx">Avoid losing the state of the global IRibbonUI ribbon object</a>. Frederique explains the problem and points to how to solve it.</p>
<h3>Performance</h3>
<p>Charles Williams has some great performance related code tips. </p>
<p><a href="http://fastexcel.wordpress.com/2011/05/25/writing-efficient-vba-udfs-part-1/">Write efficient VBA UDFs using Excel Functions inside a UDF - Part 1</a></p>
<p><a href="http://fastexcel.wordpress.com/2011/06/06/writing-efficient-vba-udfs-part-2/">Write efficient VBA UDFs using Excel Functions inside a UDF - Part 2</a></p>
<h3>Lookups</h3>
<p>Charley Kyd talks about <a href="http://exceluser.com/blog/727/excels-fastest-lookup-methods-the-tested-results.html">Excels fastest Lookup Methods</a> the INDEX MATCH dual formula approach is much faster than the single VLOOKUP formula. I have been using this method for some time now to significantly improve calculation times in large workbooks and lookups on data sets.</p>
<p>Daniel Ferry writes on Excel Hero a very good <a href="http://www.excelhero.com/blog/2011/03/the-imposing-index.html">reference guide to using the INDEX and INDEX MATCH functions</a> in numerous scenarios including dynamic range names (in place of volatile functions like OFFSET).</p>
<p>Tushar writes about how to perform <a href="http://www.tushar-mehta.com/publish_train/xl_vba_cases/0106%202D%20lookup.shtml">Two Dimensional Lookups</a>.</p>
<p>Finally Mikkel Sciegienny explains in depth <a href="http://spreadsheeto.com/index-match/" target="blank">how to use INDEX MATCH in this user friendly article</a>.</p>
https://www.spyjournal.biz/round-excel-tips-and-hints#commentsExcelINDEXMATCHOfficepivot tableRibbonVBAVLOOKUPhttps://www.spyjournal.biz/crss/node/1249Wed, 08 Jun 2011 20:10:14 +0000jethro1249 at https://www.spyjournal.bizExcel Tools and News from the web
https://www.spyjournal.biz/excel-tools-and-news-web
<p>I have had a bunch of pretty cool Excel things to post up – and finally got around to clearing my flagged items and browser windows.</p>
<h3>Conditional Formatting</h3>
<p><a href="http://www.spyjournal.biz/files/excel2007_0.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="excel 2007" border="0" alt="excel 2007" align="right" src="http://www.spyjournal.biz/files/excel2007_thumb_0.jpg" width="111" height="113" /></a>I have written a couple of articles on Conditional formatting in Excel 2007 with lots of readers comments and requests for help. They are the two most read articles on this site.</p>
<ul>
<li><a href="http://www.spyjournal.biz/conditional_format_Excel2007">Conditional formatting in Excel 2007 - entire row colours</a></li>
<li><a href="http://www.spyjournal.biz/conditionalformat_excel2007">Excel 2007 Conditional Formatting</a></li>
</ul>
<p>I was very interested then to come across this article on Joseph’s site by Amit Velingkar where he shows you <a href="http://blogs.msdn.com/excel/archive/2009/04/16/modifying-conditional-formatting-color-ranges-in-excel-2007.aspx">how to change the automatic colour ranges that are used in Excel 2007 for conditional formatting</a>. He even includes some VBA code for this.</p>
<!--break--><!--break--><h3>VLOOKUP</h3>
<p> Dick Kusleika has posted some pretty interesting information about <a href="http://www.dailydoseofexcel.com/archives/2009/04/20/vlookup/">trapping #N/A errors using the VLOOKUP formula in Excel 2007 compared to Excel 2003</a>. </p>
<blockquote><p><strong>In Excel 2003</strong>, the best way to capture this error, is to use the ISNA worksheet function, such as in this example:</p>
<p><code>=IF(ISNA(VLOOKUP("XYZ", MyTable, 2, FALSE)),"",VLOOKUP("XYZ", MyTable, 2, FALSE))</code></p>
<p>This checks to see if the formula returns the NA error and, if so, returns an empty string (to look like a blank cell). There is a big downside to this: For each cell this is used in, Excel has to calculate the VLOOKUP function twice. If you have a lot of them, it can really slow things down. Unfortunately, I don’t know of a better way.</p>
<p><strong>In Excel 2007</strong>, however, a new worksheet function was introduced. IFERROR not only shortens your formulas, but can speed up calculations. In 2007, it looks like this:</p>
<p><code>=IFERROR(VLOOKUP("XYZ", MyTable, 2, FALSE),"")</code></p>
</blockquote>
<p>He also does a very good comparison of <a href="http://www.dailydoseofexcel.com/archives/2009/04/21/vlookup-on-two-columns/">VLOOKUP, SUMPRODUCT and INDEX</a> when trying to lookup on two columns.</p>
<h3>3 days to go for this Competition!</h3>
<p>MSDN® is sponsoring a coding contest for Office 2007, named <a href="http://blogs.msdn.com/officepalooza">OfficePalooza</a>! This sweepstakes will run two weeks beginning April 20, 2009, and features ten fun Visual Basic of Applications™ (VBA) coding challenges in the form of puzzles and games. Each entrant will earn a chance to win one of hundreds of available prizes, determined by a random drawing at the end of the contest.</p>
<h3>Hierarchical Lists</h3>
<p>Dany Hoter has produced an elegant solution to a very common problem with hierarchical lists.</p>
<blockquote><p><strong>The problem:</strong> Validating data entry based on hierarchical (parent child) data. The example used is regions and countries but it could be countries and cities, product categories and sub-categories, class and student name, etc.</p>
<p>You want to enter a region from a list of regions and in the next cell you want to select a country but only from the countries which belong to that region.</p>
</blockquote>
<p>Go to <a href="http://blogs.msdn.com/excel/archive/2009/03/05/creating-dynamic-validation-ranges.aspx">Joseph Chirilov’s site to read the instructions and download the sample file</a>. I tried it – it works very well – and we will be including this solution from now on when needing to do this.</p>
https://www.spyjournal.biz/excel-tools-and-news-web#commentsconditional formattingExcelIFIFERRORINDEXISNASUMPRODUCTVBAVLOOKUPhttps://www.spyjournal.biz/crss/node/1089Fri, 01 May 2009 01:01:50 +0000jethro1089 at https://www.spyjournal.bizExcel Function of the week - Using MATCH with VLOOKUP
https://www.spyjournal.biz/excel-function-week-using-match-vlookup
<p>When I wrote the <a href="/node/992">how to use VLOOKUP and HLOOKUP article</a> a few weeks ago I hinted at writing how to use the COLUMN, ROW, MATCH, INDEX and OFFSET functions to enhance the use of the VLOOKUP and HLOOKUP functions. Today we will look at the use of MATCH.</p>
<p><a href="http://www.spyjournal.biz/files/MagnifyingGlass.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="Magnifying Glass" border="0" alt="Magnifying Glass" align="right" src="http://www.spyjournal.biz/files/MagnifyingGlass_thumb.jpg" width="205" height="260" /></a> First of all here is a common scenario.</p>
<p>You create a table of say 4 columns, and then in another sheet you create a VLOOKUP function that returns results from the 4th column. EG <font color="#800000">=VLOOKUP(lookup_value,table_range,4,FALSE)</font> where the 4 relates to the 4th column. This works great until one day you (or your colleagues) delete the 3rd column in the table, or insert another column in the middle of the table. Now your VLOOKUP fails as the 4th column either doesn’t exist, or is now actually the 5th column. In this case the VLOOKUP formula you created is just not flexible enough to handle the changes.</p>
<p>The following explanation builds on the <a href="http://www.spyjournal.biz/exceltips/2004/10/dynamic-range-names.html">dynamic range name process</a> defined in my article written back in 2004. You will need to create a dynamic range name (in this example called table_header) that works on the header row of the table you are performing the VLOOKUP on.</p>
<p>In Excel 2007 Use the Name Manager from the Formula tab. In Excel 2003 and earlier use Edit Insert Name Define. In both versions CTRL F3 is the keyboard short cut.</p>
<!--break--><!--break--><p>Here is my sample table of data in Sheet1.</p>
<p><a href="http://www.spyjournal.biz/files/image_88.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.spyjournal.biz/files/image_thumb_90.png" width="494" height="196" /></a> </p>
<p>Create a new range name and in the reference enter the OFFSET formula for a row. (assuming table is built from column A out and there is no other data in the sheet)</p>
<p><font color="#800000">=OFFSET(Sheet1!$A$1,0,0,1,COUNTA(Sheet1!$1:$1))</font></p>
<p><a href="http://www.spyjournal.biz/files/image_89.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.spyjournal.biz/files/image_thumb_91.png" width="494" height="310" /></a> </p>
<p>On another sheet  I have a VLOOKUP formula designed to return the pay rate of a selected employee from a drop down list.</p>
<p>Originally it was like the picture here with this formula <font color="#800000">=VLOOKUP(A2,Sheet1!A:D,4,FALSE)</font></p>
<p><a href="http://www.spyjournal.biz/files/image_90.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.spyjournal.biz/files/image_thumb_92.png" width="494" height="126" /></a> </p>
<p>Now in the VLOOKUP formula replace the column no (E.G. 4) with this MATCH formula <font color="#800000">MATCH(Sheet1!$D$1,table_header,0)</font> so the total formula now reads like this <font color="#800000">=VLOOKUP(A2,Sheet1!A:D,MATCH(Sheet1!$D$1,table_header,0),FALSE)</font></p>
<p>What this does is tell the formula to use the value in the header row in the column you want and return its position in the table_header range. Even if you go and change the name of that column to something else it will still work. Inserting a column in the middle of the table, or deleting a column from the table will not stop the VLOOKUP function from performing correctly.</p>
<p> </p>
<p>Finally, here is the Excel function layout and help for the MATCH function. Note the Match type argument can be –1, 0 or 1. Read the details below as to when you should use these values.</p>
<p><a href="http://www.spyjournal.biz/files/image_91.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.spyjournal.biz/files/image_thumb_93.png" width="494" height="247" /></a></p>
<p>The <b>MATCH</b> function searches for a specified item in a range of cells, and then returns the relative position of that item in the range. For example, if the range A1:A3 contains the values 5, 25, and 38, then the formula</p>
<p><b>=MATCH(25,A1:A3,0)</b></p>
<p>returns the number 2, because 25 is the second item in the range.</p>
<p>Use <b>MATCH</b> instead of one of the <b>LOOKUP</b> functions when you need the position of an item in a range instead of the item itself. For example, you might use the <b>MATCH</b> function to provide a value for the <b><i>row_num</i></b> argument of the <b>INDEX</b> function.</p>
<h4>Syntax</h4>
<pre>MATCH(lookup_value, lookup_array, [match_type])</pre><p>The <b>MATCH</b> function syntax has the following arguments:</p>
<ul>
<li><b>lookup_value</b>  Required. The value that you want to match in <b><i>lookup_array</i></b>. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.
<p>The <b><i>lookup_value</i></b> argument can be a value (number, text, or logical value) or a cell reference to a number, text, or logical value.</p>
</li>
<li><b>lookup_array</b>  Required. The range of cells being searched. </li>
<li><b>match_type</b>  Optional. The number -1, 0, or 1. The <b><i>match_type</i></b> argument specifies how Excel matches <b><i>lookup_value</i></b> with values in <b><i>lookup_array</i></b>. The default value for this argument is 1.
<p>The following table describes how the function finds values based on the setting of the <b><i>match_type</i></b> argument. </p>
<p>Match_type Behavior</p>
<p>1 or omitted - <b>MATCH</b> finds the largest value that is less than or equal to <b><i>lookup_value</i></b>. The values in the <b><i>lookup_array</i></b> argument must be placed in ascending order, for example: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.</p>
<p>0 - <b>MATCH</b> finds the first value that is exactly equal to <b><i>lookup_value</i></b>. The values in the <b><i>lookup_array</i></b> argument can be in any order.</p>
<p>-1 - <b>MATCH</b> finds the smallest value that is greater than or equal to<b><i> lookup_value</i></b>. The values in the <b><i>lookup_array</i></b> argument must be placed in descending order, for example: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and so on.</p>
</li>
</ul>
https://www.spyjournal.biz/excel-function-week-using-match-vlookup#commentsMATCHOFFSETVLOOKUPhttps://www.spyjournal.biz/crss/node/1041Thu, 12 Feb 2009 23:44:05 +0000jethro1041 at https://www.spyjournal.bizExcel Function of the Week - VLOOKUP & HLOOKUP
https://www.spyjournal.biz/excel/VLOOKUP_HLOOKUP
<p>I realised that when I wrote the <a href="/node/983">ISNA function article</a> that I had never written an explanation of VLOOKUP. I want to write up explanations for a umber of other functions in the future like COLUMN, ROW, MATCH and INDEX followed by OFFSET. All these make lots of sense when you use them with the VLOOKUP function. So I though it best to start with this function. I will also say that everything I write about VLOOKUP here applies to HLOOKUP as well. the only difference is the orientation, that is VLOOKUP looks across columns from left to right, and HLOOKUP looks down rows from top to bottom.</p>
<p><a href="http://www.spyjournal.biz/files/image_86.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.spyjournal.biz/files/image_thumb_89.png" width="594" height="326" /></a> </p>
<p>The built in Excel Help is very good at helping with this function. However it doesn't point out many of the pitfalls than occur in common use.</p>
<p>The VLOOKUP function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.): </p>
<ul>
<li>lookup_value  Required. The value to search in the first column of the table or range. The lookup_value argument can be a value or a reference. If the value you supply for the lookup_value argument is smaller than the smallest value in the first column of the table_array argument, VLOOKUP returns the #N/A error value. </li>
<li>table_array  Required. The range of cells that contains the data. You can use a reference to a range (for example, A2:D8), or a range name. The values in the first column of table_array are the values searched by lookup_value. These values can be text, numbers, or logical values. Uppercase and lowercase text are equivalent. </li>
<li>col_index_num  Required. The column number in the table_array argument from which the matching value must be returned. A col_index_num argument of 1 returns the value in the first column in table_array; a col_index_num of 2 returns the value in the second column in table_array, and so on. </li>
</ul>
<blockquote><p>If the col_index_num argument is: </p>
<ul>
<li>Less than 1, VLOOKUP returns the #VALUE! error value.</li>
<li>Greater than the number of columns in table_array, VLOOKUP returns the #REF! error value.</li>
</ul>
</blockquote>
<ul>
<li>range_lookup  Optional. A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match: </li>
</ul>
<blockquote><p>If range_lookup is either TRUE or is omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned. </p>
<p><strong>Important: </strong>If range_lookup is either TRUE or is omitted, the values in the first column of table_array must be placed in ascending sort order; otherwise, VLOOKUP might not return the correct value.</p>
<p>If range_lookup is FALSE, the values in the first column of table_array do not need to be sorted.</p>
</blockquote>
<ul>
<li>If the range_lookup argument is FALSE, VLOOKUP will find only an exact match. If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used. If an exact match is not found, the error value #N/A is returned.</li>
</ul>
<p> </p>
<p>Common Uses of VLOOKUP.</p>
<p>I use VLOOKUP frequently – many times a day and in many different ways. While I am aware that there are limitations to how it works (more on these soon) in the following circumstances it performs well.</p>
<p>Example: I have 2 columns of the same data from two spreadsheets – different versions or different data sources. I want to know if all the data is in both spreadsheets, and if not which data is missing from which sheet. Typical scenarios include account codes from an accounting system, names from a payroll system, lists of suppliers or customers, lists of gas wells from a an engineers data collection sheet etc.</p>
<p>The data may be several hundred or thousand lines long – and it is not time efficient or practical to scroll up and down the two lists comparing them. Sorting them doesn’t necessarily work, and if there are duplicates then looking at the total number in each list isn’t going to help.</p>
<p>Solution: I would copy and paste the two columns of data into column A of two separate sheets in a temporary work book (or maybe work with it in the source files and delete my work afterwards). <strong>IMPORTANT:</strong> I would then sort each list in ascending order.</p>
<p>In column B of Sheet1 I would make a formula like so: =VLOOKUP(A1,Sheet2!$A:$A,1,FALSE). After filling this down for each item in column A It is very easy to filter out all the #N/A items. These are the items that do not appear in column A of Sheet2.</p>
<p>In Sheet2 Column B I would write a formula like so: =VLOOKUP(A1,Sheet1!$A:$A,1,FALSE). After filling this down for each item in column A It is very easy to filter out all the #N/A items. These are the items that do not appear in column A of Sheet1.</p>
<p> </p>
<p>Example: I am trying to balance a set of data that is being summarised from a source set using SUMIF formulas to group the data into some top level values. The sum of these subtotals should equal the sum of the original data.</p>
<p>Eg RAW Sales data totals compared with the sum of the sales data by Salesman suing the SUMIF formula does not equal for some reason. I have checked and every line of raw data has a salesman’s name against it and each unique salesman’s name is being included in the subtotals. Or so I think. In actual fact there is a typo and there are some sales mans names that have an extra space after the name, or maybe a couple of letters transposed. This is a very common error and not easily located in a set of data of several thousand rows. (see a <a href="/exceltips/2004/12/correctly-entering-and-deleting-data.html">previous post about this problem</a>)</p>
<p>Solution: Assume the salesman’s names from the raw set of data are in column A of Sheet1 and the sales values are in column B. Column C is blank. Column A of Sheet2 is the subtotals of salesman’s names (appearing once) with the SUMIF subtotals in column B.</p>
<p>In column C of Sheet1 I would enter a formula that compares the salesman’s name from column A against the subtotal page on Sheet2 like so:=VLOOKUP(A1,Sheet2!$A:$A,1,FALSE). Once again after filling down for all the data in the raw data sheet, I can filter on this column and any #N/A values will highlight the problems – spelling mistakes, extra spaces, etc.</p>
<p> </p>
<p>That’s enough for this week. Next week I will continue on with more on VLOOKUP and HLOOKUP – more scenarios of day to day use of them, and some of the common traps, including why sorting is important.</p>
https://www.spyjournal.biz/excel/VLOOKUP_HLOOKUP#commentsHLOOKUPVLOOKUPExcelhttps://www.spyjournal.biz/crss/node/992Mon, 15 Dec 2008 09:39:54 +0000jethro992 at https://www.spyjournal.bizDeveloping in Excel 2007
https://www.spyjournal.biz/developing-excel-2007
<p>I much prefer working in Excel 2007 to Excel 2003. Despite the issues with <a href="/exceltips/2007/04/excel-2007-and-backward-compatibility.html">backward compatibility</a>, there are a lot of advantages and benefits to using the new version.</p>
<p>Some little things that have been changed are</p>
<p>The previous limit on nested brackets in formulas from 7 has been increased to 64. I used this today</p>
<p>The number of columns and rows has increased. I used this today.</p>
<p>I had to develop a file for a client that involved a complex work roster arrangement to calculate days off in repeating 2, 3 or 4 week cycles for the next 20 years.</p>
<p>Here is the nested formula that got me the logic for a roster.</p>
<p>=IF($X5>=AJ$4,$X$4,IF($Y5>=AJ$4,$Y$4,IF($Z5>=AJ$4,$Z$4,IF($AA5>=AJ$4,$AA$4,IF($AB5>=AJ$4,$AB$4, IF($AC5>=AJ$4,$AC$4,IF($AD5>=AJ$4,$AD$4,IF($AE5>=AJ$4,$AE$4,IF($AF5>=AJ$4,$AF$4,$AG$4)))))))))</p>
<p>I then used one formula to generate over 600,000 cells and create a map that looks like this.</p>
<p>=INDEX(data,MATCH(C$1,codes,0),(IF(MOD($A3,VLOOKUP(C$1,Rules!$AH:$AI,2,FALSE))=0,VLOOKUP (C$1,Rules!$AH:$AI,2,FALSE),MOD($A3,VLOOKUP(C$1,Rules!$AH:$AI,2,FALSE))))+2)</p>
<p>I used the VLOOKUP formulas because this was a quick and dirty application, not one that needed to stand the test of time. Also the speed of the calculation wasn’t an issue on my <a href="/node/392">development machine</a>. I would have built more robust formulas if this application was going to see regular use.</p>
<p><a href="http://www.spyjournal.biz/files/image_80.png"><img title="image" height="381" alt="image" src="http://www.spyjournal.biz/files/image_thumb_83.png" width="594" border="0" /></a> </p>
<p><a href="http://www.spyjournal.biz/files/image_79.png"><img title="image" height="129" alt="image" src="http://www.spyjournal.biz/files/image_thumb_82.png" width="244" align="right" border="0" /></a>From here I needed to generate a list of the “weekend” periods from their start date to end date.</p>
<p>It needed to look like the table to the right as this was going to be uploaded into their enterprise system.</p>
<p>Given the large number of cells this had the potential to go below the 65535 rows allowed in Excel 2003.</p>
<p>In the end I only used 58471 rows so was comfortably inside the limit. However if they add more rosters this could break.</p>
<p>I cannot display the code here as it is the intellectual property of the client – as they have paid for it.</p>
<p>The result for the client is huge. Entering 230,000 odd pieces of data into a system manually would have been very tedious.</p>
<p>Generating the 90 odd rosters manually and then uploading them would still have been very tedious and needed to be repeated if there were any problems or errors or new rosters.</p>
<p>This application including the initial consulting, logic development and code writing (there’s only 57 lines including all commenting)  took a little over 2 days. You do the math on how much it saved! The code runs in about 15 seconds on my system. Probably a little more on a less grunty PC. This is the power of Excel and VBA automating repetitive tasks and what we make a lot of money doing!</p>
https://www.spyjournal.biz/developing-excel-2007#commentsExcelIFINDEXMATCHMODVLOOKUPhttps://www.spyjournal.biz/crss/node/932Wed, 15 Oct 2008 02:00:24 +0000jethro932 at https://www.spyjournal.biz