primavera users are also excel users. as many of you know, microsoft excel has many useful functions in different areas such as financial, date & time, math & trig and so on. one of these areas is look up & reference. the functions in this area are dealt with lists, indexes and arrays and help us to find some special information in these listed data or other. this required information could be address of a desired cell which contains some special value, a value or action to perform a list of values, a reference specified by a text string, a relative position of an item in array that matches a specified value in a specific order and finally: a value in the leftmost column of a table and then returns a value in the same row from a column you specify.
the last function is called vlookup and i myself find it very useful in most of the planning activities. sometimes when you have some spreadsheets with heaps of information in them and you need to transfer some updated information from one list into another, vlookup helps you to do it fast and accurate. this list could be your export from primavera and you can update it from a database (which most of the time can have an output in the form of a spreadsheet) using vlookup and then import it in primavera and everything is updated now, easy and quick! let’s see how can we define and use this function in our excel vlookup tutorial.
how to write a vlookup formula
let’s start with a practical example. suppose that we have a list of updated progress of some documents and we want to update their percent completes in another list which has been exported from primavera. here are our lists:.
let’s call the right table database table and the left one primavera table. now we want to have percent complete for each document. so we start writing the formula in the activity % complete column in primavera table.
when you choose vlookup function in excel, you should complete the following inputs:
- lookup_value: this is the value that is common between our arrays and we use it to find our desired value. in this example both arrays have documents numbers in common, so we use this value as our look up value.
- table_array: in here we should input the address of our main array that have desired information in it and in which data is retrieved. we will see how we should insert the cell address in here.
- col_index_num: this number is the column number in our main array in which our desired data is located. you should notice that this number starts from one for the first column in the array that you have chosen in the previous section, so you should count columns to find your result column and input the number in here. in our example %complete is located in fifth column so we should input 5 in this part.
- range_lookup: in this part you have two logical true and false options and each one have different meanings in the formula. if you put true the function search for the closest match in the array and you should note that the search is in the ascending order. if you leave this section blank, it works like you put true in it. false means you need to find an exact match in the array, so this option is more accurate and reliable and i prefer this one because sometimes especially when you search some numbers , using true makes you confused.
now let’s get back to our example. the lookup_value for our example is activity ids in the primavera table which is called document number in the database table. our table_array starts from the first column in the database table and ends on %complete column which is our desired column for getting the result. col_index is the column number of %complete column which is 5. for getting the most accurate result let’s put the false in the range_lookup.
so our formula is like this:
as you can see for the table_array amount, the address of cells in the array has been inserted completely, rows and columns, sheet name and even file name is identified. in excel wherever you see $ sign it means that amount is fixed and if you drag the formula it is not going to be changed, so here the column and the row are both fixed and when you drag the formula for the rest of activities your array is the same but otherwise if you have not $ sign in there and you drag the formula the next one would starts from column c and row 2 till column f and row 32.
now we can take a look at results and they are amazing. we have our updated list very easy and quick:
tips
for using vlookup function there are some tips that you should consider them:
- always your lookup value should be in the first column of your table array. if you do not obey this rule the formula won’t work for you. in our example the formula searches the document number column to find out our activity ids and return their %complete and this column is the first one in the selected array. sometimes you have to replace columns to put your look up value in the first place of the array.
- when your lookup value is a text instead of numbers the format of tables are important and you need to make them similar to each other, then the formula can find the result.
- after writing the formula and drag it for all the cells of the column, maybe the result would appear in another category. in our example if i haven’t set the category of percentage for activity % complete column in primavera table, the data could be appeared in the decimal number format. therefore, you need to be sure that you set the proper format for that column.
- you remember that in the table_array part of the formula when you choose the array by dragging on the cells,the complete address of the array apppears in the formula. on the other hand, most of the time your result is getting from a different file.sometimes when you close and save both files and then change the place of the reference file (in our example database file) in your computer the formula gets confused and gives you errors. consequently you may lose your results. i prefer to copy and paste the value of formula after checking that it has worked correctly. so it doesn’t matter where i’m going to save the reference file and the next time when i open the main file, the lookup values are on their place in the file and i have them.
conclusion
vlookup is one of the most useful functions in excel especially for planners and it helps you to save your time and have many updated spreadsheet for either importing to primavera or preparing reports and charts by them. but you should consider the tips and always check the results randomly to be sure that the formula has worked correctly, because this function has many dependencies and if you miss to obey all the rules you may get the wrong results, but when you get used to it, there won’t be any error and you just enjoy its quickness.