YogiPWD

Excel Basics

 Excel Basic Functions


VLOOKUP is a very useful function in Excel that allows you to look up a value in a table and return a corresponding value from another column in that table. Here's an example to illustrate how it works:

Suppose you have a table that lists the prices of various products in column A, along with their corresponding product codes in column B:

Product Price Product Code
$10.99 A001
$12.49A002
$8.99A003
$6.99 A004
$5.49 A005

Now, let's say you want to find the price of a product with the code "A003". You can use VLOOKUP to do this. Here's how:

  1. Select the cell where you want to display the price of the product.

  2. Type the following formula into the cell:

    =VLOOKUP("A003", A1:B5, 1, FALSE)

    In this formula, "A003" is the value you're looking for, A1:B5 is the range of cells that contains the table (the first column contains the product codes, and the second column contains the prices), "1" indicates that you want to return the value from the first column (the product prices), and "FALSE" specifies that you want an exact match (if the value you're looking for isn't found in the table, you'll get an error message).

  3. Press Enter to complete the formula.

The result will be the price of the product with the code "A003", which is $8.99.

So, in summary, VLOOKUP is a useful function in Excel that allows you to look up a value in a table and return a corresponding value from another column in that table. It's particularly useful when you're working with large amounts of data and need to quickly find specific information.


HLOOKUP is a function in Excel that allows you to look up a value in a table that is arranged horizontally, rather than vertically like the table used in VLOOKUP. Here's an example to illustrate how it works:

Suppose you have a table that lists the sales figures for various products in different regions, with the products listed in row 1 and the regions listed in column A:

Product AProduct BProduct C
Region 1$10,000$15,000$8,000
Region 2$12,000$18,000$6,000
Region 3$8,000$20,000$10,000

Now, let's say you want to find the sales figure for Product B in Region 3. You can use HLOOKUP to do this. Here's how:

  1. Select the cell where you want to display the sales figure.

  2. Type the following formula into the cell:

    =HLOOKUP("Product B", A1:D4, 4, FALSE)

    In this formula, "Product B" is the value you're looking for, A1:D4 is the range of cells that contains the table (the first row contains the product names, and the first column contains the region names), "4" indicates that you want to return the value from the fourth row (which corresponds to Region 3), and "FALSE" specifies that you want an exact match (if the value you're looking for isn't found in the table, you'll get an error message).

  3. Press Enter to complete the formula.

The result will be the sales figure for Product B in Region 3, which is $20,000.

So, in summary, HLOOKUP is a function in Excel that allows you to look up a value in a table that is arranged horizontally, rather than vertically like the table used in VLOOKUP. It's particularly useful when you have a table with a large number of columns and need to quickly find specific information.


The SUMIF function in Excel is used to add up values that meet a specific condition. It allows you to specify a range of cells to check for the condition, and a separate range of cells to add up if the condition is met. Here's an example to illustrate how it works:

Suppose you have a table that lists the sales figures for various products, along with their categories:

ProductCategorySales
AFood$1,000
BElectronics$2,500
C Food$750
DClothing$1,200
EElectronics$1,500
FClothing$900

Now, let's say you want to find the total sales for all products in the "Food" category. You can use the SUMIF function to do this. Here's how:

  1. Select the cell where you want to display the total sales.

  2. Type the following formula into the cell:

    =SUMIF(B2:B7, "Food", C2:C7)

    In this formula, B2:B7 is the range of cells that contains the categories, "Food" is the condition you're checking for, and C2:C7 is the range of cells that contains the sales figures. The function will add up all the sales figures for products that are in the "Food" category.

  3. Press Enter to complete the formula.

The result will be the total sales for all products in the "Food" category, which is $1,750.

So, in summary, the SUMIF function in Excel is a useful tool for adding up values that meet a specific condition. It's particularly useful when you need to quickly find the total for a subset of data in a large table.


The SUMIFS function in Excel is similar to the SUMIF function, but it allows you to specify multiple conditions. It allows you to add up values that meet multiple criteria at the same time. Here's an example to illustrate how it works:

Suppose you have a table that lists the sales figures for various products, along with their categories and regions:

ProductCategoryRegionSales
AFoodEast $1,000
BElectronicsWest$2,500
CFoodNorth$750
DClothingSouth $1,200
EElectronicsEast$1,500
FClothingNorth$900

Now, let's say you want to find the total sales for all products in the "Food" category that were sold in the "East" region. You can use the SUMIFS function to do this. Here's how:

  1. Select the cell where you want to display the total sales.

  2. Type the following formula into the cell:

    =SUMIFS(D2:D7, B2:B7, "Food", C2:C7, "East")

    In this formula, D2:D7 is the range of cells that contains the sales figures, B2:B7 is the range of cells that contains the categories, "Food" is the first condition you're checking for, C2:C7 is the range of cells that contains the regions, "East" is the second condition you're checking for. The function will add up all the sales figures for products that are in the "Food" category and were sold in the "East" region.

  3. Press Enter to complete the formula.

The result will be the total sales for all products in the "Food" category that were sold in the "East" region, which is $1,000.

So, in summary, the SUMIFS function in Excel is a useful tool for adding up values that meet multiple criteria at the same time. It's particularly useful when you need to quickly find the total for a subset of data in a large table based on multiple conditions.


The COUNTIF function in Excel is used to count the number of cells that meet a specific condition. It allows you to specify a range of cells to check for the condition, and it returns the number of cells in that range that meet the condition. Here's an example to illustrate how it works:

Suppose you have a table that lists the sales figures for various products, along with their categories:

ProductCategorySales
AFood$1,000
BElectronics$2,500
CFood$750
DClothing$1,200
EElectronics$1,500
FClothing$900

Now, let's say you want to find the number of products that fall into the "Food" category. You can use the COUNTIF function to do this. Here's how:

  1. Select the cell where you want to display the result.

  2. Type the following formula into the cell:

    =COUNTIF(B2:B7, "Food")

    In this formula, B2:B7 is the range of cells that contains the categories, "Food" is the condition you're checking for. The function will count the number of cells in the range that contain the value "Food."

  3. Press Enter to complete the formula.

The result will be the number of products in the "Food" category, which is 2.

So, in summary, the COUNTIF function in Excel is a useful tool for counting the number of cells that meet a specific condition. It's particularly useful when you need to quickly find the number of items in a large table that meet a specific criteria.


The COUNTIFS function in Excel is similar to the COUNTIF function, but it allows you to specify multiple conditions. It allows you to count the number of cells that meet multiple criteria at the same time. Here's an example to illustrate how it works:

Suppose you have a table that lists the sales figures for various products, along with their categories and regions:

ProductCategoryRegionSales
AFoodEast$1,000
BElectronicsWest$2,500
CFoodNorth$750
DClothingSouth$1,200
EElectronicsEast$1,500
FClothingNorth$900

Now, let's say you want to find the number of products that fall into the "Food" category and were sold in the "East" region. You can use the COUNTIFS function to do this. Here's how:

  1. Select the cell where you want to display the result.
  2. Type the following formula into the cell:

    =COUNTIFS(B2:B7, "Food", C2:C7, "East")

    In this formula, B2:B7 is the range of cells that contains the categories, "Food" is the first condition you're checking for, C2:C7 is the range of cells that contains the regions, "East" is the second condition you're checking for. The function will count the number of cells in the range that meet both conditions.

  3. Press Enter to complete the formula.

The result will be the number of products in the "Food" category that were sold in the "East" region, which is 1.

So, in summary, the COUNTIFS function in Excel is a useful tool for counting the number of cells that meet multiple criteria at the same time. It's particularly useful when you need to quickly find the number of items in a large table that meet multiple criteria simultaneously.


The INDEX function in Excel is used to return the value of a cell in a specified row and column of a table or range. It's particularly useful when you need to retrieve a value from a large table or range based on its position. Here's an example to illustrate how it works:

Suppose you have a table that lists the sales figures for various products, along with their categories and regions:

ProductCategoryRegionSales
AFoodEast$1,000
BElectronicsWest$2,500
CFoodNorth$750
DClothingSouth$1,200
EElectronics East$1,500
FClothingNorth$900

Now, let's say you want to retrieve the sales figure for product "C." You can use the INDEX function to do this. Here's how: 1. Select the cell where you want to display the result. 2. Type the following formula into the cell: =INDEX(D2:D7, MATCH("C", A2:A7, 0)) In this formula, D2:D7 is the range of cells that contains the sales figures, "C" is the value you're looking for in the table, A2:A7 is the range of cells that contains the product names. The MATCH function is used to find the position of "C" in the list of product names, and the INDEX function is used to return the corresponding value from the list of sales figures. 3. Press Enter to complete the formula. The result will be the sales figure for product "C," which is $750. So, in summary, the INDEX function in Excel is a useful tool for retrieving a value from a table or range based on its position. It's particularly useful when you need to quickly find a value in a large table or range based on its location in the table. The MATCH function in Excel is used to find the position of a value in a list or range of cells. It returns the relative position of the value in the list, which can be used in combination with other functions like INDEX or VLOOKUP to retrieve the corresponding value. Here's an example to illustrate how it works: Suppose you have a list of product names and sales figures:

Product Sales
A$1,000
B$2,500
C$750
D$1,200
E$1,500
F$900

Now, let's say you want to find the position of product "D" in the list. You can use the MATCH function to do this. Here's how:

  1. Select the cell where you want to display the result.

  2. Type the following formula into the cell:

    =MATCH("D", A2:A7, 0)

    In this formula, "D" is the value you're looking for in the list, A2:A7 is the range of cells that contains the product names. The "0" at the end of the formula is used to specify that you want an exact match.

  3. Press Enter to complete the formula.

The result will be the position of "D" in the list, which is 4.

So, in summary, the MATCH function in Excel is a useful tool for finding the position of a value in a list or range of cells. It can be used in combination with other functions like INDEX or VLOOKUP to retrieve the corresponding value based on its position in the list.


The INDEX and MATCH functions are often used together in Excel to lookup and retrieve values from a table or range based on specific criteria. The INDEX function returns a value from a specified location within a range or array, while the MATCH function returns the position of a value within a range or array. Here's an example to illustrate how to use INDEX and MATCH together:

Suppose you have a table that shows the sales figures for various products and regions:

ProductRegionSales
AEast$1,000
BWest$2,500
CNorth$750
DSouth $1,200
EEast$1,500
FNorth$900

Now, let's say you want to find the position of product "D" in the list. You can use the MATCH function to do this. Here's how: 1. Select the cell where you want to display the result. 2. Type the following formula into the cell: =MATCH("D", A2:A7, 0) In this formula, "D" is the value you're looking for in the list, A2:A7 is the range of cells that contains the product names. The "0" at the end of the formula is used to specify that you want an exact match. 3. Press Enter to complete the formula. The result will be the position of "D" in the list, which is 4. So, in summary, the MATCH function in Excel is a useful tool for finding the position of a value in a list or range of cells. It can be used in combination with other functions like INDEX or VLOOKUP to retrieve the corresponding value based on its position in the list. The INDEX and MATCH functions are often used together in Excel to lookup and retrieve values from a table or range based on specific criteria. The INDEX function returns a value from a specified location within a range or array, while the MATCH function returns the position of a value within a range or array. Here's an example to illustrate how to use INDEX and MATCH together: Suppose you have a table that shows the sales figures for various products and regions:

ProductRegionSales
AEast$1,000
BWest$2,500
CNorth$750
DSouth$1,200
EEast$1,500
FNorth$900

Now, let's say you want to retrieve the sales figure for product "E" in the "East" region. You can use the INDEX and MATCH functions to do this. Here's how: 1. Select the cell where you want to display the result. 2. Type the following formula into the cell: =INDEX(C2:C7, MATCH("E"&"East", A2:A7&B2:B7, 0)) In this formula, C2:C7 is the range of cells that contains the sales figures, "E"&"East" concatenates the values "E" and "East" into a single string, A2:A7&B2:B7 concatenates the product names and region names into a single string for each row, and the "0" at the end of the formula is used to specify that you want an exact match. 3. Press Enter to complete the formula. The result will be the sales figure for product "E" in the "East" region, which is $1,500. So, in summary, the INDEX and MATCH functions can be used together in Excel to lookup and retrieve values from a table or range based on specific criteria. By using the CONCATENATE operator "&" to create a single lookup value, the MATCH function can find the position of the exact match in the table, which is then used by the INDEX function to return the corresponding value. The VLOOKUP and MATCH functions are often used together in Excel to lookup and retrieve values from a table or range based on specific criteria. The VLOOKUP function returns a value from a table based on a lookup value, while the MATCH function returns the position of a value within a range or array. Here's an example to illustrate how to use VLOOKUP and MATCH together: Suppose you have a table that shows the sales figures for various products and regions:

ProductRegionSales
AEast$1,000
BWest$2,500
CNorth$750
DSouth$1,200
EEast$1,500
FNorth $900

If you want to find the total sales for the East region, you can apply a filter to the table, select a cell where you want to display the total, and then type the following formula:

=SUBTOTAL(9, C2:C7)

This will give you the total sales for the East region, which is $2,500.

So, in summary, to find the sum of filtered values in Excel, you can use the SUBTOTAL function with the SUM function (9 as its first argument) and the range of cells to be summed as its second argument.


The INDIRECT function in Excel is used to reference a cell range based on the text string provided as input. The function can be useful when you need to dynamically reference a range that is not known in advance, or when you need to reference a range based on user input or the result of another formula. Here's an example to illustrate how to use the INDIRECT function:

Suppose you have a workbook that contains multiple sheets, each with a list of products and their corresponding sales figures for a particular month. The sheet names follow a standard format of "Month-Year", such as "Jan-2022", "Feb-2022", etc.

Now, let's say you want to create a summary sheet that shows the total sales for a specific product across all months. To do this, you could use the INDIRECT function to reference the sales figures for each month based on the sheet names. Here's how:

  1. Create a cell where you can enter the name of the product you want to summarize.

  2. Create a list of the month names in a column, starting from the cell below the product name.

  3. In the cell to the right of each month name, use the following formula:

    =INDIRECT("'"&A2&"'!B2:B100")

    In this formula, A2 is the cell that contains the month name, and B2:B100 is the range of cells that contains the sales figures for that month. The single quotes around the sheet name are used to tell Excel that the name is a text string.

  4. Copy the formula down to the other month names in the list.

The result will be a column of sales figures for the specified product for each month. You can then use a SUM formula to add up the sales figures to get the total for the product across all months.

For example, let's say you enter the product name "Product A" in cell A1, and the month names "Jan-2022" to "Jun-2022" in cells A2 to A7. You can then use the INDIRECT function to reference the sales figures for each month, as shown below:

Product NameJan-2022Feb-2022Mar-2022Apr-2022May-2022Jun-2022
Product A=INDIRECT("'"&A2&"'!B2:B100")=INDIRECT("'"&A3&"'!B2:B100")=INDIRECT("'"&A4&"'!B2:B100")=INDIRECT("'"&A5&"'!B2:B100")=INDIRECT("'"&A6&"'!B2:B100")=INDIRECT("'"&A7&"'!B2:B100")

You can then use a SUM formula to add up the sales figures for Product A across all months, like this:

=SUM(B2:B7)

This will give you the total sales for Product A across all months.

So, in summary, the INDIRECT function in Excel can be used to reference a cell range based on the text string provided as input. By using this function, you can create dynamic references to ranges that are not known in advance, or that are based on user input or the result of another formula.


The LINEST function in Excel is used to calculate the statistics for a line that best fits a set of data points, using the least squares method. It returns an array of values that represent the slope, y-intercept, r-squared value, standard error of the slope, and standard error of the y-intercept of the line of best fit.

Here's an example to illustrate how to use the LINEST function:

Suppose you have a set of data points that represent the relationship between the temperature and the sales of ice cream for a particular month. You want to determine the equation of the line of best fit and the R-squared value for the data set. Here's how to use the LINEST function to accomplish this:

  1. Create a table with two columns: one for the temperature values and one for the corresponding sales figures.

  2. Select a blank cell where you want to display the LINEST results.

  3. Type the following formula:

    =LINEST(B2:B10, A2:A10, TRUE, TRUE)

    In this formula, B2:B10 is the range of cells that contains the sales figures, and A2:A10 is the range of cells that contains the temperature values. The TRUE arguments at the end of the formula indicate that you want the LINEST function to return the slope and y-intercept values, as well as the r-squared value and the standard errors of the slope and y-intercept.

  4. Press Ctrl + Shift + Enter to enter the formula as an array formula.

The result will be an array of values that represent the slope, y-intercept, r-squared value, standard error of the slope, and standard error of the y-intercept of the line of best fit. You can then use these values to write the equation of the line of best fit and to interpret the statistical significance of the line.

For example, let's say you have the following table of temperature and sales data:

Temperature (C)Sales (units)
15100
20150
25200
30250
35300
40350
45400
50450
55500

If you use the LINEST function as described above, you will get an array of values that includes the following:

  • The slope of the line of best fit: 10
  • The y-intercept of the line of best fit: -50
  • The r-squared value of the line of best fit: 0.9945
  • The standard error of the slope: 0.2927
  • The standard error of the y-intercept: 24.4949

You can use the slope and y-intercept values to write the equation of the line of best fit: y = 10x - 50. You can use the r-squared value to determine how well the line of best fit represents the data. An r-squared value of 0.9945 indicates that the line of best fit explains 99.45% of the variation in the data. The standard errors can be used to calculate confidence intervals for the slope and y-intercept values.

So, in summary, the LINEST function in Excel can be used to calculate the statistics for a line that best fits a set of data points, using the least squares method. By using this function, you can determine the equation of the line of best fit and the R-squared value for a set of data, and interpret


Interpolation is the process of estimating values between known data points. Excel provides several methods to interpolate values in a data set, such as linear interpolation, polynomial interpolation, and spline interpolation.

Here's how to perform linear interpolation in Excel:

Suppose you have a set of data points that represent the relationship between the temperature and the sales of ice cream for a particular month. You want to estimate the sales figure for a temperature of 27 degrees Celsius, which is between the known data points of 25 and 30 degrees Celsius.

  1. Create a table with two columns: one for the temperature values and one for the corresponding sales figures.

  2. Enter the known data points in the table.

  3. Select a blank cell where you want to display the interpolated value.

  4. Type the following formula:

    =FORECAST(27, A2:A6, B2:B6)

    In this formula, 27 is the temperature value you want to interpolate, A2:A6 is the range of cells that contains the temperature values in the table, and B2:B6 is the range of cells that contains the sales figures in the table.

  5. Press Enter to calculate the interpolated value.

The result will be an estimated sales figure for a temperature of 27 degrees Celsius, based on linear interpolation between the known data points.

Note: The FORECAST function in Excel performs linear interpolation. If you want to perform other types of interpolation, you can use different functions, such as TREND for polynomial interpolation or SPLINE for spline interpolation.

In summary, Excel provides several methods to interpolate values in a data set. By using these functions, you can estimate values between known data points and make more accurate predictions based on your data.


The IRR function in Excel is used to calculate the internal rate of return for a series of cash flows. The internal rate of return is the discount rate at which the net present value (NPV) of the cash flows equals zero. The IRR function is commonly used in financial analysis to evaluate the profitability of an investment or a project.

Here's an example of how to use the IRR function in Excel:

Suppose you are considering an investment that requires an initial investment of $10,000 and is expected to generate the following cash flows over the next five years:

Year 1: $2,000 Year 2: $3,000 Year 3: $4,000 Year 4: $5,000 Year 5: $6,000

To calculate the internal rate of return for this investment, you can use the IRR function in Excel as follows:

  1. Create a column in Excel to list the cash flows. In this example, enter the cash flows in cells A1 to A6.

  2. In a cell where you want to display the IRR value, enter the following formula:

    =IRR(A1:A6)

    This formula calculates the internal rate of return for the cash flows listed in cells A1 to A6.

  3. Press Enter to calculate the IRR value.

The result of the IRR calculation should be approximately 17.6%, indicating that the investment is profitable and has a rate of return of 17.6% per year.

Note that the IRR function assumes that the cash flows occur at regular intervals and that the first cash flow occurs at the beginning of the first period. If your cash flows do not meet these criteria, you may need to adjust your calculations or use a different method to calculate the internal rate of return.

In summary, the IRR function in Excel is a powerful tool for evaluating the profitability of investments and projects. By using this function, you can calculate the internal rate of return for a series of cash flows and make more informed financial decisions.


The XIRR function in Excel is used to calculate the internal rate of return (IRR) for a series of cash flows that occur at irregular intervals. The XIRR function takes into account the exact dates on which the cash flows occur, making it more accurate than the IRR function for investments with irregular or non-periodic cash flows.

Here's an example of how to use the XIRR function in Excel:

Suppose you invest $10,000 in a project that generates the following cash flows:

Date Cash Flow 1-Jan-2020 -$10,000 15-Feb-2020 $2,000 30-Jun-2020 $3,000 31-Dec-2020 $4,000 15-Apr-2021 $5,000 30-Sep-2021 $6,000

To calculate the internal rate of return for this investment using the XIRR function in Excel, follow these steps:

  1. Create a table with two columns: one for the dates and one for the corresponding cash flows.

  2. Enter the dates and cash flows in the table.

  3. Select a blank cell where you want to display the IRR value.

  4. Type the following formula:

    =XIRR(B2:B7,A2:A7)

    In this formula, B2:B7 is the range of cells that contains the cash flows, and A2:A7 is the range of cells that contains the corresponding dates.

  5. Press Enter to calculate the IRR value.

The result of the XIRR calculation should be approximately 22.5%, indicating that the investment is profitable and has a rate of return of 22.5% per year.

Note that the XIRR function requires both the cash flows and the corresponding dates to be listed in the table. If you have missing dates or cash flows, you may need to adjust your calculations or use a different method to calculate the internal rate of return.

In summary, the XIRR function in Excel is a powerful tool for evaluating the profitability of investments and projects with irregular or non-periodic cash flows. By using this function, you can calculate the internal rate of return based on the exact dates of the cash flows and make more informed financial decisions.


If you have a list of chainage intervals in Excel and want to convert them into the 54/030 form, you can use a simple formula to do so. Here are the steps to follow:

  1. Create two columns in your Excel sheet. In the first column, enter the interval values in meters (e.g., 100, 200, 500, etc.). In the second column, you will enter the converted chainages in the 54/030 form.

  2. In the first cell of the second column (e.g., cell B2), enter the formula "=INT(A2/1000)&"/"&TEXT(A2-INT(A2/1000)*1000,"000")". This formula will convert the meter value in cell A2 into the 54/030 form and display the result in cell B2.

  3. Copy the formula in cell B2 and paste it into the rest of the cells in the second column. This will automatically convert all the interval values into the 54/030 form.

  4. Format the second column as text to ensure that Excel doesn't change the formatting of the chainages.

  5. If you want to change the interval values in the future, simply update the values in the first column, and the chainages in the second column will automatically update using the formula.

Post a Comment

0 Comments