Académique Documents
Professionnel Documents
Culture Documents
▼ September (2)
Multi-Level Numbering - Excel
User Defined In this Tutorial, I
Functions
(UDF)
Followers
Follow
with Google Friend Connect
Followers (5)
Already a member?Sign in
Click OK to close the Option dialog box.
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 2 of 23
We can resize the windows by left-clicking where the resize icons, holding and moving sideways
or up and down.
The VBE creates a New Module (Module1) inside the project (See Project window).
Note: If we record any macro, the macro will be stored inside the module only.
Every custom function (UDF) begins with the key word ‘Function’ followed by the name of the
function and parentheses. It ends with the key word ‘End Function’.
VBE will automatically insert this End Function key word, once we hit the enter key after typing
the function, function name and the parentheses.
When we make single payment to the Contractor, if the contract payment is Rs.30000 or more
and the type of the contract is Individual/HUF, 1% on the Contract Payment will be deducted as
TDS (if the contractor is other than individual/HUF, then 2% on the contract payment will be
deducted as TDS). If the single payment is less then Rs. 30000, no TDS will be deducted on the
contract payment.
Type the code inside the code windows as given in the below picture.
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 3 of 23
Explanation:
1. Close the VBE window. Go to the excel and select any worksheet.
2. Select B1 and type ‘others’
3. Select B2 and type ‘35000’
4. Enter our formula as given in the below picture.
5. Function will return ‘700’ as TDS. (i.e. 2% on 35000, because amount is not less
than 30000 and the contractor type is others)
6. Change your inputs and see the result.
Before we start, just estimate how much time it will take to number the 247 titles
along with Chapter numbers like 1-1, 1-2….27-1, 27-2….27-n. I guarantee that we
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 4 of 23
Is that possible?
Step 1:
=IF(ISBLANK(A4),B3,B3+1)
Picture A: If fuction
Formula Explanation:
Step 2:
1. Double click the Fill Handle Fill Handle: The small black square in
the lower-right corner of the selection. When you point to the Fill Handle, the
pointer changes to a black cross
2. All the remaining 245 rows will be filled with corresponding Chapter Numbers
as shown in below picture.
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 5 of 23
Step 3:
=IF(ISBLANK(A4),C3+1,1)
Picture D: IF Function
Formula Explanation:
Step 4:
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 6 of 23
Press OK
4. Enter the field with the values as given in the below image and press OK
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 7 of 23
In this session, we are going to discuss how to use Advance Filter when the Auto
filter fails to give the desired results.
Custom Auto filter (Picture 1) will help us to filter data with the maximum of TWO
filter criteria only. When we have more than TWO criteria, we have to use the
Advanced Filter.
Before applying the Advance Filter what are all necessary information we should
require?
1. Data Table
2. Criteria Table
1. DATA Table:
2. CRITERIA Table
I have already mentioned that to filter the data with more than two criteria, we are
using the Advanced Filter option. In Picture 2, we are having FOUR different
products; out of these we are going to select THREE products as Filter criteria to
filter the data.
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 8 of 23
Both the basic things are ready.Now, how to apply the Advance Filter?
1. List Range
2. Criteria Range
1. LIST RANGE:
1. By selecting the Advance Filter itself, System will select the List range
automatically.
2. If List range is not picked up automatically or if you want to restrict the data
range, then you have to click Collapse Dialog button to choose the List
Range.
3. Select the Database Table where you want to apply filter.
2. Criteria Range
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 9 of 23
RESULT:
1. It is a default option.
2. Now, if we press OK Button, Advanced Filter will filter the data and show the
result (Row index will be turned in BLUE colour) in the Database Table itself.
(See the row index 4,5,7,8 and 9 are not visible now)
3. Here, we have to give the cell reference where the filtered result should be
printed.
4. Press OK
Please create the following table and try the exercise to get a clear idea about the
Advance filter and feel the difference
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 10 of 23
Exercise 1:
Exercise 2:
Exercise 3:
Exercise 4:
A dealer wants to give a festival offer to his customers. He announces the following
discounts.
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 11 of 23
Pick the appropriate discount rates for the following cases with the help of
VLOOKUP function:
Without looking at the solution try these cases... if you are unable to find the
solution then read further.
VLOOKUP Function
Here, we are giving FOUR Input parameters. Let us concentrate only on the fourth
parameter now to solve this case.
Range_lookup
While using Vlookup function, we are used to assign FALSE (0) as Range_Lookup.
What will be the result if I assign TRUE (1) as Range_Lookup?
FALSE (0) as Range_Lookup: VLOOKUP will find the exact match, and if it
is not found, it will return an error value (#N/A).
TRUE (1) as Range_Lookup: This function will return the exact match,
and if the same is unavailable, it will return the approximate match. In
other words, if VLOOKUP can't find lookup_value, it uses the largest value
that is less than or equal to lookup_value.
To solve the above said cases we have to use TRUE (1) as Range_lookup.
To illustrate, I am going to take the 3rd case - Y orders 2500 units of product A. (to
explain the first 2 cases, we need some assistance from other function to get the
result. We can get the result for the first 2 cases with the help of combined
functions only.)
CASE 3:
Syntax is =vlookup(2500,A1:B4,2,1)
The function will return 10% as result as “2500” will not exactly match with the
database. So, the function will look for the next highest value that is less than
2500.
To check this formula, you can try with some other units (say 499 units, 950 units
or with exact values 0, 500 and 1000)
OTHER CASES
In the previous case, we have used 2 as column index to find the discount rate for
2500 units of Product A. we know that the details of Product A are available under
column 2. How can we assist the system to find the column index automatically
instead of feeding the column index manually?
MATCH Function
This function will return the relative position of an item from the selected area (i.e
row or column)
Syntax: =match(lookup_value,lookup_array,match_type)
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 12 of 23
=match(“Product B”,A1:D1,0)
COMBINED FUNCTION
Now we are going to solve the first 2 cases. For that we have to combine VLOOKUP
function and MATCH function to get the desired result.
CASE 1:
Here we have two inputs i.e ITEM and ORDER QTY. First, we need to find the
discount rate for Product B when the ordering quantity is 100 units.
Instead of giving column index manually, here we have inserted MATCH function to
get the column index. (To test this function, change the item name as Product A or
Product C)
Now, Try the rest (You already know how to use) to get the net value of the
ordered quantity.
REMEMBER
If it is not so, the function may not find the largest value that is lower
than the lookup value.
Home
Recent Comments
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 13 of 23
Karthik wrote...
Proud of u Mani.
Harish wrote...
Ur step by step explanation is good. but now this option is readily available in Excel 2007, where you can choose/filter for multiple items at one go.
Juned wrote...
Very nice Kamaraj...Keep it up :)
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 14 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 15 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 16 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 17 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 18 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 19 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 20 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 21 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 22 of 23
http://msofficetuts.blogspot.com/ 30.09.10
MS Office Tuts - Kamaraj Mani Page 23 of 23
http://msofficetuts.blogspot.com/ 30.09.10