New Post has been published on Gamble Computer Solutions
New Post has been published on http://gamblecomputersolutions.com/free-computer-tutorials/microsoft-excel/retrieving-the-last-value-and-the-last-character-in-a-row-in-microsoft-excel-2010/
Retrieving the Last Value and the Last Character in a Row in Microsoft Excel 2010
To retrieve the last value, we use a combination of âINDEXâ, âMAXâ, and âCOLUMNâ functions, and to retrieve the last character in a row, we use the âHLOOKUPâ and âREPTâ functions in Microsoft Excel 2010.
INDEX: The Index formula returns a value from the intersection between the row number and the column number in an Array. There are 2 syntaxes for the âINDEXâ function.
1st Syntax of âINDEXâ function:=INDEX (array, row_num, [column_num])
2nd Syntax of âINDEXâ function:=INDEX (reference, row_num, [column_num], [area_num])
For example:- We have data in range A1:C5 in which column A contains Order Id, column B contains Unit Price, and column C contains Quantity.
Follow below given steps:-
Write the formula in cell D2.
Press Enter on your keyboard.
The function will return 10, which means 10 is available in 2nd row and 3rd column.
Â
Â
MAX: This function is used to return the largest number in a set of values. It ignores logical values and text.
Syntax of âMAXâ function:           =MAX(number1, [number2],âŚ.)
Example: Range A1:A4 contains numbers, and we need to return the maximum number from this range. Â
Follow the below given steps:-
Select the cell B1 and write the formula.
Press Enter on your keyboard.
The function will return 9.
9 is the maximum value in the range A1:A4.Â
Â
Â
COLUMN: This function is used to return the column number of a reference.
Syntax of âCOLUMNâ function:Â Â Â Â =COLUMN(reference)
For Example: If we want to return the column number for the cell A1, we need to follow below given steps:-
Write the formula in cell B2.
Press Enter on your keyboard.
The function will return 1, which means this is column 1.
Â
Â
HLOOKUP: The function is used for looking a value in the top row of a table or array of values and returns the value in the same column from a row you specify.
Syntax of âHLOOKUPâ function:Â Â Â Â Â Â Â Â Â Â Â =HLOOKUP(lookup_value,table_array,row_index_num,[range_lookup])
We use this function to pick the values from one data to another, but to meet the condition we should have the common values in both data sets so that we can easily pick the value.
Letâs take an example and understand how and where we can use Vlookup function in Microsoft Excel 2010.
Example 1: We have 2 data sets in which we require joining date from 1st data to 2nd data.
Â
Â
To pick the value from 1st data to 2nd data, the common value we have is Emp. Code. So we will put the Hlookup function through Emp. Code. We need to follow below mentioned steps to pick the joining date:-
Select the cell C9 and write the formula.
=HLOOKUP(C8,$ C$ 2:$ G$ 3,2,false)
Press Enter on your keyboard.
The function will return the joining date for this L1056 Emp code.
To return the date of joining to all the employees, copy the same formula and paste in the range D9:G9.
Â
Â
Note: If the common value we do not have in other data from which we want to pick the data, then the formula will give the #N/A error. As you can see in above snapshot, the employee code L1089 in not available in 1st data set so formula is giving the error.
REPT:- This function is used to repeat text a given number of times. Use REPT to fill a cell with a number of instances of text string.
Syntax of âREPTâ function:Â Â Â Â Â Â Â Â Â Â =COLUMN(reference)
For example:- Write the formula in cell A1 =REPT(âaâ,10), and press Enter on your keyboard. The function will show that âaâ is repeating 10 times.
Â
Â
MODE: This function is available for compatibility with Excel 2007 and earlier. It returns the most frequently occurring or repetitive value in an array or range of data.
Syntax of âMODEâ function:         =MODE(number1, [number2],âŚâŚ..)
For Example:-We have number list in the range A1:A5.
To return the mode of numbers, follow below given steps:-
Write the formula in cell B1.
Press Enter on your keyboard.
The function will return 1.
Â
Â
IF: - Check whether a condition is met and returns one value if True and another value if False.
The syntax of âIFâ function =if(logical test,[value_if_true],[value_if_false])
Firstly, the formula will do the logical test to know if the output of logical test is true or false.
For example:Cell A2 and A3 contain the number 3 and 5. If the number is 3, the formula should display âYesâ, else âNoâ.
=IF (A1=3,âYesâ,âNoâ)
Â
Â
Letâs take an example to understand how we can retrieve the last value and the last character in a row.
We have data in range A2:E5 in which cells contain characters and numbers individually. Some of the cells in the range may be empty.
We want to retrieve both the last values (of any type) and the last character that appears in each row of the range.
Â
Â
To find the last character for each row, follow below given steps:-
Write the formula in cell F2.
=HLOOKUP(REPT(âzâ,10),A2:E2,1)
Press Enter on your keyboard.
The function will return the last character for each row.
Â
 Copy the same formula by pressing the key Ctrl+C and paste in the range F3:F5 by pressing the key Ctrl+V on your keyboard.
Â
Â
To find the last value (of any type) in each row, follow below given steps:-
Write the formula in cell G2.
=INDEX(A2:E2,1,MAX(IF(A2:E2<>ââ,COLUMN(A2:E2)))-COLUMN(A2)+1)
Press Shift+Ctrl+Enter on your keyboard.
=INDEX(A2:E2,1,MAX(IF(A2:E2<>ââ,COLUMN(A2:E2)))-COLUMN(A2)+1)
The function will return the last character for each row.
Â
 Copy the same formula by pressing the key Ctrl+C and paste in the range G3:G5 by pressing the key Ctrl+V on your keyboard.
Â
Â
 This entry passed through the Full-Text RSS service â if this is your content and youâre reading it on someone elseâs site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.
Microsoft Excel Tips from Excel Tip .com / Excel Tutorial / Free Excel Help