SlideShare a Scribd company logo
Copyright © 2017 IQVIA. All rights reserved.
Basic functions and formulas in excel &
Macros
Patents Intelligence Team
Getting Started with
Microsoft Excel
Table of
Contents
1
+ Introduction to Excel Formulas
• What is a function ?
• Types of functions in MS excel
• Function categories with examples
• Features of Excel to analyze the data
• Formulas that can be build in excel with pre-defined function
+ Introduction to Excel Macros
• What is a macro?
• How to enable a macro?
• How to record and replay a macro?
• How to extract data using a macro?
• Basics of VBA
• Example
2
Introduction to Excel Formulas
3
Functions are predefined formulas that are already available in excel.
What is a function?
• Excel has got over 400 pre defined formulae's such as (sum, if, VLOOKUP),these are technically referred to as function.
• How to access the predefined functions in excel ?
• Difference between formula and function in excel ?
• A formula is any calculation in excel, but a function is a predefined calculation.
• Example- =A1/A2 is a formula
=MAX(A1:B20) is a formula containing a MAX function.
4
The function can be Broadly categories into FIVE categories.
• LOOKUP FUNCTION- VLOOKUP
HLOOKUP
• TEXT FUNCTION – TRIM
LEN
CONCETNATE
• LOGICAL FUNCTION- AND
IF
OR
• DATE FUNCTION- DATEDIF
EDATE
• MATHEMATICAL FUNCTION- COUNTIF
Type of functions
5
VLOOKUP-. The VLOOKUP (Vertical lookup) function looks for a value in the leftmost column of a table, and then returns a
value in the same row from another column you specify.
In simple words ,VLOOKUP is used to look up a value from a different location in your workbook. It’s useful because when
dealing with large amounts of data because you always need to look things up.
Syntax- =VLOOKUP(ItemToFind,RangeToLookIn,ColumnToPickFrom,Rangelookup)
Lets break the syntax into parts .
1. ITEM TO FIND -The value you want to look up LOOKUP_VALUE
2. RANGE TO LOOKIN-The table of data you want the information retrieved from. The ‘look up table’ TABLE_ARRAY.
3. COLUMN TO PICK FROM-The column containing information you want to bring back. The column
number column COL-INDEX-NUM.
4. Rangelookup – this is also known as True or false, TRUE will look for the value closest while FALSE will look for an
exact match.
LOOKUP FUNCTION
6
• When we have a large data set of patents in a file and we need to find a specific information about a patent number we
can use a VLOOKUP.
• EXAMPLE – From the given set of patents ,we need to find the secondary status for
TW200412944,TW200412961,TW200412962.
Lets see how it works
7
A new dialog box
will appear.
Add the arguments in the lookupvalue,table array ,columns index num,and
range lookup value column.
8
• Lookup value-Patent number that we want to lookup(h2)
• Table array- the table from where we want to retrieved
the information (a2:b10).
• Column index –the secondary status information column
that we are looking for (2).
• Range lookup-either true or false (false for exact
information).
• Press OK.
9
HLOOKUP-. The HLOOKUP function looks for a value in the topmost row of a table, and then return a corresponding value
in the same column from a row.
• The HLOOKUP is a sibling of VLOOKUP function, the H in the HLOOKUP stands for “Horizontal” and hence it is often
called as Horizontal lookup
• Horizontal Lookup performs a case insensitive lookup. This means, it treats “STEVE” and “steve” as same.
• ‘range lookup’ is an optional argument. If it is omitted then HLOOKUP takes its default value as TRUE (approximate
match).
Syntax- =HLOOKUP(ItemToFind,RangeToLookIn,RowToPickFrom,Rangelookup)
Lets break the syntax into parts .
1. ITEM TO FIND -The value you want to look up LOOKUP_VALUE
2. RANGE TO LOOKIN-The table of data you want the information retrieved from. The ‘look up table’ TABLE_ARRAY.
3. COLUMN TO PICK FROM-The containing information you want to bring back. The row number row ROW-INDEX-NUM.
4. Rangelookup – this is also known as True or false, TRUE will look for the value closest while FALSE will look for an
exact match.
10
Consider ,we have a student marks table and we need to find the Chetana marks in computer.so, for this we can use
HLOOKUP.
Lets see how it works
How to add H
LOOKUP?
11
Add the arguments in the lookup value, table array, row index
num and in range lookup column.
• Lookup value-Student name that we want to lookup(b7)
• Table array- the table from where we want to retrieved
the information (c1:14).
• Row index –the computer marks information row that we
are looking for (4).
• Range lookup-either true or false (false for exact
information).
• Press OK.
12
So, Chetna has got 98 marks in computer .
13
LEN- This function counts the number of characters, including spaces and number, in a piece of text.
Syntax- LEN(TEXT)
When to use – when we have a data set and we want to calculate the number of characters in the given data set .we can
use LEN function
EXAMPLE – From the given patent data set ,we want to calculate the number of characters of the given patent number .
TEXT FUNCTION
Excel has many functions to offer when it comes to manipulate text strings.
14
• Apply the syntax - =LEN(Column number )
=LEN(A5)
• Press ok.
We can get the number of
characters in A5 columns -12.
15
TRIM-This function removes unwanted spaces from a piece of text.
• The spaces before and after the text will be removed completely.
• Multiple spaces within the text will be trimmed to a single space.
Syntax- =TRIM(TexttoTrim)
EXAMPLE- From the given patent data set we want to clear the unwanted space in the patent number column.
To access TRIM function, go to Formulas bar
and then to text and choose TRIM Function.
16
• Apply the syntax- =TRIM(A2)
• Press ok
We can eliminate the extra space.
17
CONCATENATE- This function joins separate pieces of text into one item.
• CONCATENATE can join up to 30 text items together.
• Text items can be text strings, numbers, or cell references that refer to one cell.
Syntax- =CONCATENATE(Text1,Text2,Text3...Text30).
EXAMPLE- From the given patent data set ,we want to join the primary and secondary status of a given set of patent .
To access concatenate function,
go to formula bar ,then select text
option and go to CONCATENATE
18
• Apply the CONCATENATE-B2(Primary Status)
( (open bracket)
) (close bracket)
C2 (Secondary Status)
We will get the primary status and secondary
status of patent CONCATENATE.
19
AND FUNCTION-This function tests two or more conditions to see if they are all true
• It can be used to test that a series of numbers meet certain conditions.
• It can be used to test that a number or a date falls between an upper and lower limit.
• When it is used by itself it will show TRUE OR FALSE.
• But, Normally the AND() function would be used in conjunction with a function such as =IF().
Syntax- =AND (TEST1,TEST2)
• Note that there can be up to 30 possible tests
EXAMPLE - In the given Patents data set ,we want to see that the expiry dates that we have got for a set of patents are
recorded according to the united kingdom patent expiry rules or not and is their filing date is after 31/5/1983,so that we can
the AND FUNCTION.
LOGICAL FUNCTIONS
20
Apply the function
• B2 IS Filling date
• In 20 years we have 730 days
• C2 Is given expiry date
• So we apply =AND (B2+7305=c2)
• And we also need to find that filing date is after 31/5/1983
• So we add up in the same and formula =AND(B2+7305=C2,AND(B2>”1983-5-31”))
• If it follow the rule then it will give TRUE else FALSE.
21
We get to know that are the patents following the EP
rule and is their filing date is after 31/5/1983.
22
IF FUNCTION-The IF function can perform a logical test and return one value for a TRUE result, and another for a FALSE
result.
How the function works -
• This function tests a condition.
• If the condition is met it is considered to be TRUE.
• If the condition is not met it is considered as FALSE.
• Depending upon the result, one of two actions will be carried out.
Syntax- =IF(Condition,ActionIfTrue,ActionIfFalse)
• The ActionIfTrue and ActionIfFalse can be numbers, text or calculations.
EXAMPLE- we have a given set of patents number and we need to find the error in their expiry dates according to united
kingdom expiry rules .
23
Apply the function-
• In 20 years there are 7305 days ,than f.d+7305=true
• If the days will be 7304 days ,than f.d +7304=EP patents with -1 days
• And if there are some other date except above two condition, than result will
be false
24
We get the correct expiry dates status
according to U.K Rules
25
DATEDIF -This function calculates the difference between two dates.
• It can show the result in weeks, months or years.
Syntax- =DATEDIF(FirstDate,SecondDate,"Interval")
Lets break the syntax into parts
• First Date : This is the earliest of the two dates.
• Second Date : This is the most recent of the two dates.
• "Interval" : This indicates what you want to calculate.
These are the available intervals-
DATE FUNCTION
The DATE function is a built-in function in Excel that is categorized as a Date/Time Function. It can
be used as a worksheet function (WS) in Excel.
26
EXAMPLE- we need to find out the difference between patent expiry date and extension date in terms of years from the
given patent data set
Apply the function-=DATEDIF
• B2-EXPIRY DATE
• C2-EXTENSION EXPIRY DATE
• Y-DIFFERENCE IN YEARS
We can get the difference
between two date in terms of
years.
27
EDATE- This function is used to calculate a date which is a specific number of months in the past or in the future.
• The result will normally be expressed as a number, this can be formatted to represent a date by using the
Format,Cells,Number,Date command.
Syntax- =EDATE(StartDate,Months)
EXAMPLE- For the given patent set of data ,the extension is provided in terms of months and we need to calculate the
extension expiry date by using the EDATE formula .
28
Apply the Function- =EDATE
B2-Expiry date to which extension months will
be added.
C2- Extension months to be added
PRESS OK.
we get the EXTENSION EXPIRY
DATE.
29
COUNTIF- This function counts the number of items which match criteria set by the user.
• COUNTIF can be used to count cells with dates, numbers, and text that match specific criteria.
• The COUNTIF function supports logical operators (>,<,<>,=) and wildcards (*,?) for partial matching.
Syntax- =COUNTIF(RangeOfThingsToBeCounted,CriteriaToBeMatched)
EXAMPLE- In the given patent data set we need to find the following things-
MATHEMATICAL FUNCTIONS
Mathematical Formulas in Excel are used to perform various arithmetic operations like adding
the values in a range of cells, finding average of selected cells etc.
30
Apply the function –
=COUNTIF
• Select the range of sheet in
which you want to search
the patent number (a2:c14)
• Type the name of “patent
number” you want to search
(EP0200322)
• PRESS OK
Apply the function – =COUNTIF
• Select the range of sheet in
which you want to search the
DRUG (a2:c14)
• Type the name of “DRUG” you
want to search
(LERCANIDIPINE)
• PRESS OK
31
We get the number of time “EPO200322” ,”LERCANIDIPINE” is repeated also we are able to find the number
of dates before “5/1/2006” in expiry date column.
32
HIGHLIGHT THE DUPLICATES VALUE – TO find the duplicates value in the given set of data .
CONDITIONAL FORMATTING
Conditional formatting in Excel enables you to highlight cells with a certain color, depending on the cell's value
Select the entire
set in which u need
to find the
duplicates
33
2. On the Home tab, in the Styles group, click Conditional Formatting
3. Click Highlight Cells Rules, Duplicate Values.
4. Select a formatting style and click OK.
34
EXCEL HIGHLIGHT THE DUPLICATE
NAMES.
35
• Text to Columns can be used to separate data in a single column into multiple columns, such as if you have full names in
one column and need a column with first names and a column with last names.
EXAMPLE- we have patent data set in which the primary status and secondary status of a patent are mentioned in one
column and we need to separated them into two different columns.
How to access the text to column function –
• Go to data bar,datatools ,Text to column, the text to column wizard opens
TEXT TO COLUMN FUNCTION
36
• A new dialog box
will open.
• Select space from
the options
• Press next
37
The primary and secondary
status get separated into tow
columns
• Select general from column
data format
• Press Finish.
38
• In the U.K project ,we have the EP AND GB Designated patents, and we need to find the correct expiry date of the
patents, and the errors in the data we have received .
Use of Excel function in Patent Data checks
39
First ,we need to apply Text to column
function to separate the patent expiry
date and extension date .
So after applying the text to
column section
(delimited),we got the two
dates separated.
Then, apply CONCATENATE to combine
drug name with the patent number so that
we can find the duplicates can eliminate
the them.
40
• Apply IF function to get the errors in the expiry date of the patents ,before this the expiry check rules for u.k are –
• According to these rule apply IF function to create a formula to get the Errors in the Expiry date of patents .
• Normal syntax for IF function - = IF(Condition,ActionIfTrue,ActionIfFalse)
• Formula framed by using IF function - =IF(J1="EP",IF(K1+7305=O1,"True",IF(K1+7304=O1,"EP patent with -1
day","False")),IF(J1="GB",IF(K1+7304=O1,"True",IF(K1+7305=O1,"GB without -1 day",IF(K1+5843=O1,"Older GB
patent expiry OK","False")))))
41
EP PATENTS -
In 20 years the number of days -7305-condition will be true
In 20 years (-1) number of days -7304- condition will be EP (-1) Day.
If number of days are not the above one –condition will be false
GB PATENTS-
In 20 years the number of days -7305-condition will be GB Without -1 day
In 20 years (-1) number of days -7304-condition will be true.
For older GB Patents –
For patents filed before 1 June 1967 –filing date +16(-1 day)-condition will be older gb patents expiry ok
If any of the condition is not matching for the GB patents –condition will be false
• Final formula - =IF(J1="EP",IF(K1+7305=O1,"True",IF(K1+7304=O1,"EP patent with -1
day","False")),IF(J1="GB",IF(K1+7304=O1,"True",IF(K1+7305=O1,"GB without -1 day",IF(K1+5843=O1,"Older GB
patent expiry OK","False")))))
• * We can also used the EDATE FUNCTION in case if we want to add years (20or 16) instead of days that we have used
in formula .
Apply the formula in excel sheet and we will get the errors in the expiry date of EP OR GB patents designated to U.K.
42
We got the errors in the expiry dates ,and we can correct
them by adding or subtracting 1 day for (EP Patent with -1
day ,GB Patents without -1 day ),and we can correct the
false expiry by following the U.K expiry rules .
43
• NAVIGATE WORKSHEET-
Excel shortcut keys.
44
• SELECT CELLS-
45
• EDIT CELL CONTENTS-
46
• DUPLICATE FUNCTIONS -
47
For Germany we can apply all these strategies to mark the errors in their Expiry dates and to sort data –
• Remove the duplicate
• Separate the patent expiry date from(PAT)
• Follow the Germany expiry rules ,to build a Expiry formula
• Mark the incorrect expiry and make them the correct
• Germany expiry RULES –
.
EXCERCISE
48
Introduction to Excel Macros
49
A brief intro
What is a macro?
• Macros are little programs that run within Excel and help automate common repetitive tasks.
• Macros are one of Excel’s most powerful, yet underutilized feature.
• Using macros, you can save hours and boost productivity manifold.
• Different ways to use a macro:
- Record a macro
- Write a command in VBA
50
A step-by-step illustration
How to enable Developer menu in the Menu Bar?
51
Continued…
52
A step-by-step illustration
How to enable a macro?
53
Continued…
How to enable a macro?
54
How to record a macro?
Continued…
55
Continued…
56
To view the recorded macro:
57
A step-by-step illustration:
How to extract data using a macro?
58
Continued…
59
A brief introduction:
Basics in VBA
• Excel VBA means Excel Visual Basic for Applications which can be created using the built-in Visual Basic Editor in
Microsoft Excel.
• VBA is not just for repetitive tasks though. We can also use VBA to build new capabilities into Excel and to perform tasks
that integrate Excel with other Office applications such as Microsoft Access 2010.
• For example, you could develop new algorithms to analyze your data, then use the charting capabilities in Excel to display
the results.
60
Example: A modified macro for processing Belgium Database
http://bpp.economie.fgov.be/fo-eregister-
view/application?lng=fr&number=EP2214636
61
Continued…
62
Continued…
63
Continued…
64
Continued…
65
66
PREPARED BY –
SANGITHA V
JATIN MISHRA
SPECIAL CREDITS –
RAJENDIRAN SUNDARAVEL

More Related Content

What's hot (19)

PDF
Lesson 5 link list
MLG College of Learning, Inc
 
PPTX
Singly & Circular Linked list
Khulna University of Engineering & Tecnology
 
PDF
8 python data structure-1
Prof. Dr. K. Adisesha
 
PPTX
Lecture 5 data structures and algorithms
Aakash deep Singhal
 
PPT
Database structure Structures Link list and trees and Recurison complete
Adnan abid
 
PPTX
data structures and algorithms Unit 3
infanciaj
 
PPT
Stacks & Queues
tech4us
 
PPT
Linked list
Trupti Agrawal
 
PPT
linked list
Narendra Chauhan
 
PDF
Stacks,queues,linked-list
pinakspatel
 
PDF
pyton Notes6
Amba Research
 
PPT
Link List
umiekalsum
 
PPTX
Data structure , stack , queue
Rajkiran Nadar
 
PPT
Unit 2 linked list and queues
kalyanineve
 
PPT
Singly link list
Rojin Khadka
 
PDF
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Balwant Gorad
 
PPT
Data Structure and Algorithms Linked List
ManishPrajapati78
 
PPTX
Arrays in Data Structure and Algorithm
KristinaBorooah
 
Lesson 5 link list
MLG College of Learning, Inc
 
Singly & Circular Linked list
Khulna University of Engineering & Tecnology
 
8 python data structure-1
Prof. Dr. K. Adisesha
 
Lecture 5 data structures and algorithms
Aakash deep Singhal
 
Database structure Structures Link list and trees and Recurison complete
Adnan abid
 
data structures and algorithms Unit 3
infanciaj
 
Stacks & Queues
tech4us
 
Linked list
Trupti Agrawal
 
linked list
Narendra Chauhan
 
Stacks,queues,linked-list
pinakspatel
 
pyton Notes6
Amba Research
 
Link List
umiekalsum
 
Data structure , stack , queue
Rajkiran Nadar
 
Unit 2 linked list and queues
kalyanineve
 
Singly link list
Rojin Khadka
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Balwant Gorad
 
Data Structure and Algorithms Linked List
ManishPrajapati78
 
Arrays in Data Structure and Algorithm
KristinaBorooah
 

Similar to Getting started with microsoft excel. (20)

PPTX
MIS 226: Chapter 2
macrob14
 
PPTX
Excel Overview.pptx
NewmanLeke
 
PPTX
Using Excel Functions
Gautam Gupta
 
PPTX
Excel Function Training
kapileshwar kumar
 
PPT
Get more from excel
Gopal Sridharan
 
PPTX
Advance excel
SiddheshHadge
 
PPTX
10 Excel Formulas that will help you in any Job
Hitesh Biyani
 
PPTX
Ms excel
Hitendrasinh Zala
 
PPTX
it skill excel sheet for ppt.pptx
MdAquibRazi1
 
PPTX
Useful Excel Functions & Formula Used everywhere.pptx
vanshikatyagi74
 
PDF
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
Rakesh Sah
 
PPT
042-MIS105-L07.ppt
MuqaddasKhalid5
 
PPTX
Microsoft Excel
Naomi Faith Ebuen
 
PPTX
Elementary Data Analysis with MS Excel_Day-3
Redwan Ferdous
 
PPTX
1.2 Zep Excel.pptx
PizzaM
 
PPTX
Excel basics for everyday use part three
Kevin McLogan
 
PDF
Excel.useful fns
Rahul Singhal
 
PDF
Excel Formulas Functions
simply_coool
 
PPTX
Advanced Spreadsheet Skills-1.pptx
CliffordBorromeo
 
MIS 226: Chapter 2
macrob14
 
Excel Overview.pptx
NewmanLeke
 
Using Excel Functions
Gautam Gupta
 
Excel Function Training
kapileshwar kumar
 
Get more from excel
Gopal Sridharan
 
Advance excel
SiddheshHadge
 
10 Excel Formulas that will help you in any Job
Hitesh Biyani
 
it skill excel sheet for ppt.pptx
MdAquibRazi1
 
Useful Excel Functions & Formula Used everywhere.pptx
vanshikatyagi74
 
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
Rakesh Sah
 
042-MIS105-L07.ppt
MuqaddasKhalid5
 
Microsoft Excel
Naomi Faith Ebuen
 
Elementary Data Analysis with MS Excel_Day-3
Redwan Ferdous
 
1.2 Zep Excel.pptx
PizzaM
 
Excel basics for everyday use part three
Kevin McLogan
 
Excel.useful fns
Rahul Singhal
 
Excel Formulas Functions
simply_coool
 
Advanced Spreadsheet Skills-1.pptx
CliffordBorromeo
 
Ad

Recently uploaded (20)

PPTX
BinarySearchTree in datastructures in detail
kichokuttu
 
PPTX
05_Jelle Baats_Tekst.pptx_AI_Barometer_Release_Event
FinTech Belgium
 
PDF
InformaticsPractices-MS - Google Docs.pdf
seshuashwin0829
 
PPTX
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
PPTX
美国史蒂文斯理工学院毕业证书{SIT学费发票SIT录取通知书}哪里购买
Taqyea
 
PPTX
04_Tamás Marton_Intuitech .pptx_AI_Barometer_2025
FinTech Belgium
 
PDF
apidays Singapore 2025 - How APIs can make - or break - trust in your AI by S...
apidays
 
PPTX
01_Nico Vincent_Sailpeak.pptx_AI_Barometer_2025
FinTech Belgium
 
PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PPTX
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
PDF
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
PDF
Unlocking Insights: Introducing i-Metrics Asia-Pacific Corporation and Strate...
Janette Toral
 
PDF
apidays Singapore 2025 - Trustworthy Generative AI: The Role of Observability...
apidays
 
PDF
NIS2 Compliance for MSPs: Roadmap, Benefits & Cybersecurity Trends (2025 Guide)
GRC Kompas
 
PDF
Technical-Report-GPS_GIS_RS-for-MSF-finalv2.pdf
KPycho
 
PDF
Using AI/ML for Space Biology Research
VICTOR MAESTRE RAMIREZ
 
PDF
Research Methodology Overview Introduction
ayeshagul29594
 
PPTX
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
PPTX
Feb 2021 Ransomware Recovery presentation.pptx
enginsayin1
 
PDF
apidays Singapore 2025 - Building a Federated Future, Alex Szomora (GSMA)
apidays
 
BinarySearchTree in datastructures in detail
kichokuttu
 
05_Jelle Baats_Tekst.pptx_AI_Barometer_Release_Event
FinTech Belgium
 
InformaticsPractices-MS - Google Docs.pdf
seshuashwin0829
 
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
美国史蒂文斯理工学院毕业证书{SIT学费发票SIT录取通知书}哪里购买
Taqyea
 
04_Tamás Marton_Intuitech .pptx_AI_Barometer_2025
FinTech Belgium
 
apidays Singapore 2025 - How APIs can make - or break - trust in your AI by S...
apidays
 
01_Nico Vincent_Sailpeak.pptx_AI_Barometer_2025
FinTech Belgium
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
apidays Singapore 2025 - Generative AI Landscape Building a Modern Data Strat...
apidays
 
apidays Singapore 2025 - The API Playbook for AI by Shin Wee Chuang (PAND AI)
apidays
 
Unlocking Insights: Introducing i-Metrics Asia-Pacific Corporation and Strate...
Janette Toral
 
apidays Singapore 2025 - Trustworthy Generative AI: The Role of Observability...
apidays
 
NIS2 Compliance for MSPs: Roadmap, Benefits & Cybersecurity Trends (2025 Guide)
GRC Kompas
 
Technical-Report-GPS_GIS_RS-for-MSF-finalv2.pdf
KPycho
 
Using AI/ML for Space Biology Research
VICTOR MAESTRE RAMIREZ
 
Research Methodology Overview Introduction
ayeshagul29594
 
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
Feb 2021 Ransomware Recovery presentation.pptx
enginsayin1
 
apidays Singapore 2025 - Building a Federated Future, Alex Szomora (GSMA)
apidays
 
Ad

Getting started with microsoft excel.

  • 1. Copyright © 2017 IQVIA. All rights reserved. Basic functions and formulas in excel & Macros Patents Intelligence Team Getting Started with Microsoft Excel
  • 2. Table of Contents 1 + Introduction to Excel Formulas • What is a function ? • Types of functions in MS excel • Function categories with examples • Features of Excel to analyze the data • Formulas that can be build in excel with pre-defined function + Introduction to Excel Macros • What is a macro? • How to enable a macro? • How to record and replay a macro? • How to extract data using a macro? • Basics of VBA • Example
  • 4. 3 Functions are predefined formulas that are already available in excel. What is a function? • Excel has got over 400 pre defined formulae's such as (sum, if, VLOOKUP),these are technically referred to as function. • How to access the predefined functions in excel ? • Difference between formula and function in excel ? • A formula is any calculation in excel, but a function is a predefined calculation. • Example- =A1/A2 is a formula =MAX(A1:B20) is a formula containing a MAX function.
  • 5. 4 The function can be Broadly categories into FIVE categories. • LOOKUP FUNCTION- VLOOKUP HLOOKUP • TEXT FUNCTION – TRIM LEN CONCETNATE • LOGICAL FUNCTION- AND IF OR • DATE FUNCTION- DATEDIF EDATE • MATHEMATICAL FUNCTION- COUNTIF Type of functions
  • 6. 5 VLOOKUP-. The VLOOKUP (Vertical lookup) function looks for a value in the leftmost column of a table, and then returns a value in the same row from another column you specify. In simple words ,VLOOKUP is used to look up a value from a different location in your workbook. It’s useful because when dealing with large amounts of data because you always need to look things up. Syntax- =VLOOKUP(ItemToFind,RangeToLookIn,ColumnToPickFrom,Rangelookup) Lets break the syntax into parts . 1. ITEM TO FIND -The value you want to look up LOOKUP_VALUE 2. RANGE TO LOOKIN-The table of data you want the information retrieved from. The ‘look up table’ TABLE_ARRAY. 3. COLUMN TO PICK FROM-The column containing information you want to bring back. The column number column COL-INDEX-NUM. 4. Rangelookup – this is also known as True or false, TRUE will look for the value closest while FALSE will look for an exact match. LOOKUP FUNCTION
  • 7. 6 • When we have a large data set of patents in a file and we need to find a specific information about a patent number we can use a VLOOKUP. • EXAMPLE – From the given set of patents ,we need to find the secondary status for TW200412944,TW200412961,TW200412962. Lets see how it works
  • 8. 7 A new dialog box will appear. Add the arguments in the lookupvalue,table array ,columns index num,and range lookup value column.
  • 9. 8 • Lookup value-Patent number that we want to lookup(h2) • Table array- the table from where we want to retrieved the information (a2:b10). • Column index –the secondary status information column that we are looking for (2). • Range lookup-either true or false (false for exact information). • Press OK.
  • 10. 9 HLOOKUP-. The HLOOKUP function looks for a value in the topmost row of a table, and then return a corresponding value in the same column from a row. • The HLOOKUP is a sibling of VLOOKUP function, the H in the HLOOKUP stands for “Horizontal” and hence it is often called as Horizontal lookup • Horizontal Lookup performs a case insensitive lookup. This means, it treats “STEVE” and “steve” as same. • ‘range lookup’ is an optional argument. If it is omitted then HLOOKUP takes its default value as TRUE (approximate match). Syntax- =HLOOKUP(ItemToFind,RangeToLookIn,RowToPickFrom,Rangelookup) Lets break the syntax into parts . 1. ITEM TO FIND -The value you want to look up LOOKUP_VALUE 2. RANGE TO LOOKIN-The table of data you want the information retrieved from. The ‘look up table’ TABLE_ARRAY. 3. COLUMN TO PICK FROM-The containing information you want to bring back. The row number row ROW-INDEX-NUM. 4. Rangelookup – this is also known as True or false, TRUE will look for the value closest while FALSE will look for an exact match.
  • 11. 10 Consider ,we have a student marks table and we need to find the Chetana marks in computer.so, for this we can use HLOOKUP. Lets see how it works How to add H LOOKUP?
  • 12. 11 Add the arguments in the lookup value, table array, row index num and in range lookup column. • Lookup value-Student name that we want to lookup(b7) • Table array- the table from where we want to retrieved the information (c1:14). • Row index –the computer marks information row that we are looking for (4). • Range lookup-either true or false (false for exact information). • Press OK.
  • 13. 12 So, Chetna has got 98 marks in computer .
  • 14. 13 LEN- This function counts the number of characters, including spaces and number, in a piece of text. Syntax- LEN(TEXT) When to use – when we have a data set and we want to calculate the number of characters in the given data set .we can use LEN function EXAMPLE – From the given patent data set ,we want to calculate the number of characters of the given patent number . TEXT FUNCTION Excel has many functions to offer when it comes to manipulate text strings.
  • 15. 14 • Apply the syntax - =LEN(Column number ) =LEN(A5) • Press ok. We can get the number of characters in A5 columns -12.
  • 16. 15 TRIM-This function removes unwanted spaces from a piece of text. • The spaces before and after the text will be removed completely. • Multiple spaces within the text will be trimmed to a single space. Syntax- =TRIM(TexttoTrim) EXAMPLE- From the given patent data set we want to clear the unwanted space in the patent number column. To access TRIM function, go to Formulas bar and then to text and choose TRIM Function.
  • 17. 16 • Apply the syntax- =TRIM(A2) • Press ok We can eliminate the extra space.
  • 18. 17 CONCATENATE- This function joins separate pieces of text into one item. • CONCATENATE can join up to 30 text items together. • Text items can be text strings, numbers, or cell references that refer to one cell. Syntax- =CONCATENATE(Text1,Text2,Text3...Text30). EXAMPLE- From the given patent data set ,we want to join the primary and secondary status of a given set of patent . To access concatenate function, go to formula bar ,then select text option and go to CONCATENATE
  • 19. 18 • Apply the CONCATENATE-B2(Primary Status) ( (open bracket) ) (close bracket) C2 (Secondary Status) We will get the primary status and secondary status of patent CONCATENATE.
  • 20. 19 AND FUNCTION-This function tests two or more conditions to see if they are all true • It can be used to test that a series of numbers meet certain conditions. • It can be used to test that a number or a date falls between an upper and lower limit. • When it is used by itself it will show TRUE OR FALSE. • But, Normally the AND() function would be used in conjunction with a function such as =IF(). Syntax- =AND (TEST1,TEST2) • Note that there can be up to 30 possible tests EXAMPLE - In the given Patents data set ,we want to see that the expiry dates that we have got for a set of patents are recorded according to the united kingdom patent expiry rules or not and is their filing date is after 31/5/1983,so that we can the AND FUNCTION. LOGICAL FUNCTIONS
  • 21. 20 Apply the function • B2 IS Filling date • In 20 years we have 730 days • C2 Is given expiry date • So we apply =AND (B2+7305=c2) • And we also need to find that filing date is after 31/5/1983 • So we add up in the same and formula =AND(B2+7305=C2,AND(B2>”1983-5-31”)) • If it follow the rule then it will give TRUE else FALSE.
  • 22. 21 We get to know that are the patents following the EP rule and is their filing date is after 31/5/1983.
  • 23. 22 IF FUNCTION-The IF function can perform a logical test and return one value for a TRUE result, and another for a FALSE result. How the function works - • This function tests a condition. • If the condition is met it is considered to be TRUE. • If the condition is not met it is considered as FALSE. • Depending upon the result, one of two actions will be carried out. Syntax- =IF(Condition,ActionIfTrue,ActionIfFalse) • The ActionIfTrue and ActionIfFalse can be numbers, text or calculations. EXAMPLE- we have a given set of patents number and we need to find the error in their expiry dates according to united kingdom expiry rules .
  • 24. 23 Apply the function- • In 20 years there are 7305 days ,than f.d+7305=true • If the days will be 7304 days ,than f.d +7304=EP patents with -1 days • And if there are some other date except above two condition, than result will be false
  • 25. 24 We get the correct expiry dates status according to U.K Rules
  • 26. 25 DATEDIF -This function calculates the difference between two dates. • It can show the result in weeks, months or years. Syntax- =DATEDIF(FirstDate,SecondDate,"Interval") Lets break the syntax into parts • First Date : This is the earliest of the two dates. • Second Date : This is the most recent of the two dates. • "Interval" : This indicates what you want to calculate. These are the available intervals- DATE FUNCTION The DATE function is a built-in function in Excel that is categorized as a Date/Time Function. It can be used as a worksheet function (WS) in Excel.
  • 27. 26 EXAMPLE- we need to find out the difference between patent expiry date and extension date in terms of years from the given patent data set Apply the function-=DATEDIF • B2-EXPIRY DATE • C2-EXTENSION EXPIRY DATE • Y-DIFFERENCE IN YEARS We can get the difference between two date in terms of years.
  • 28. 27 EDATE- This function is used to calculate a date which is a specific number of months in the past or in the future. • The result will normally be expressed as a number, this can be formatted to represent a date by using the Format,Cells,Number,Date command. Syntax- =EDATE(StartDate,Months) EXAMPLE- For the given patent set of data ,the extension is provided in terms of months and we need to calculate the extension expiry date by using the EDATE formula .
  • 29. 28 Apply the Function- =EDATE B2-Expiry date to which extension months will be added. C2- Extension months to be added PRESS OK. we get the EXTENSION EXPIRY DATE.
  • 30. 29 COUNTIF- This function counts the number of items which match criteria set by the user. • COUNTIF can be used to count cells with dates, numbers, and text that match specific criteria. • The COUNTIF function supports logical operators (>,<,<>,=) and wildcards (*,?) for partial matching. Syntax- =COUNTIF(RangeOfThingsToBeCounted,CriteriaToBeMatched) EXAMPLE- In the given patent data set we need to find the following things- MATHEMATICAL FUNCTIONS Mathematical Formulas in Excel are used to perform various arithmetic operations like adding the values in a range of cells, finding average of selected cells etc.
  • 31. 30 Apply the function – =COUNTIF • Select the range of sheet in which you want to search the patent number (a2:c14) • Type the name of “patent number” you want to search (EP0200322) • PRESS OK Apply the function – =COUNTIF • Select the range of sheet in which you want to search the DRUG (a2:c14) • Type the name of “DRUG” you want to search (LERCANIDIPINE) • PRESS OK
  • 32. 31 We get the number of time “EPO200322” ,”LERCANIDIPINE” is repeated also we are able to find the number of dates before “5/1/2006” in expiry date column.
  • 33. 32 HIGHLIGHT THE DUPLICATES VALUE – TO find the duplicates value in the given set of data . CONDITIONAL FORMATTING Conditional formatting in Excel enables you to highlight cells with a certain color, depending on the cell's value Select the entire set in which u need to find the duplicates
  • 34. 33 2. On the Home tab, in the Styles group, click Conditional Formatting 3. Click Highlight Cells Rules, Duplicate Values. 4. Select a formatting style and click OK.
  • 35. 34 EXCEL HIGHLIGHT THE DUPLICATE NAMES.
  • 36. 35 • Text to Columns can be used to separate data in a single column into multiple columns, such as if you have full names in one column and need a column with first names and a column with last names. EXAMPLE- we have patent data set in which the primary status and secondary status of a patent are mentioned in one column and we need to separated them into two different columns. How to access the text to column function – • Go to data bar,datatools ,Text to column, the text to column wizard opens TEXT TO COLUMN FUNCTION
  • 37. 36 • A new dialog box will open. • Select space from the options • Press next
  • 38. 37 The primary and secondary status get separated into tow columns • Select general from column data format • Press Finish.
  • 39. 38 • In the U.K project ,we have the EP AND GB Designated patents, and we need to find the correct expiry date of the patents, and the errors in the data we have received . Use of Excel function in Patent Data checks
  • 40. 39 First ,we need to apply Text to column function to separate the patent expiry date and extension date . So after applying the text to column section (delimited),we got the two dates separated. Then, apply CONCATENATE to combine drug name with the patent number so that we can find the duplicates can eliminate the them.
  • 41. 40 • Apply IF function to get the errors in the expiry date of the patents ,before this the expiry check rules for u.k are – • According to these rule apply IF function to create a formula to get the Errors in the Expiry date of patents . • Normal syntax for IF function - = IF(Condition,ActionIfTrue,ActionIfFalse) • Formula framed by using IF function - =IF(J1="EP",IF(K1+7305=O1,"True",IF(K1+7304=O1,"EP patent with -1 day","False")),IF(J1="GB",IF(K1+7304=O1,"True",IF(K1+7305=O1,"GB without -1 day",IF(K1+5843=O1,"Older GB patent expiry OK","False")))))
  • 42. 41 EP PATENTS - In 20 years the number of days -7305-condition will be true In 20 years (-1) number of days -7304- condition will be EP (-1) Day. If number of days are not the above one –condition will be false GB PATENTS- In 20 years the number of days -7305-condition will be GB Without -1 day In 20 years (-1) number of days -7304-condition will be true. For older GB Patents – For patents filed before 1 June 1967 –filing date +16(-1 day)-condition will be older gb patents expiry ok If any of the condition is not matching for the GB patents –condition will be false • Final formula - =IF(J1="EP",IF(K1+7305=O1,"True",IF(K1+7304=O1,"EP patent with -1 day","False")),IF(J1="GB",IF(K1+7304=O1,"True",IF(K1+7305=O1,"GB without -1 day",IF(K1+5843=O1,"Older GB patent expiry OK","False"))))) • * We can also used the EDATE FUNCTION in case if we want to add years (20or 16) instead of days that we have used in formula . Apply the formula in excel sheet and we will get the errors in the expiry date of EP OR GB patents designated to U.K.
  • 43. 42 We got the errors in the expiry dates ,and we can correct them by adding or subtracting 1 day for (EP Patent with -1 day ,GB Patents without -1 day ),and we can correct the false expiry by following the U.K expiry rules .
  • 46. 45 • EDIT CELL CONTENTS-
  • 48. 47 For Germany we can apply all these strategies to mark the errors in their Expiry dates and to sort data – • Remove the duplicate • Separate the patent expiry date from(PAT) • Follow the Germany expiry rules ,to build a Expiry formula • Mark the incorrect expiry and make them the correct • Germany expiry RULES – . EXCERCISE
  • 50. 49 A brief intro What is a macro? • Macros are little programs that run within Excel and help automate common repetitive tasks. • Macros are one of Excel’s most powerful, yet underutilized feature. • Using macros, you can save hours and boost productivity manifold. • Different ways to use a macro: - Record a macro - Write a command in VBA
  • 51. 50 A step-by-step illustration How to enable Developer menu in the Menu Bar?
  • 55. 54 How to record a macro? Continued…
  • 57. 56 To view the recorded macro:
  • 58. 57 A step-by-step illustration: How to extract data using a macro?
  • 60. 59 A brief introduction: Basics in VBA • Excel VBA means Excel Visual Basic for Applications which can be created using the built-in Visual Basic Editor in Microsoft Excel. • VBA is not just for repetitive tasks though. We can also use VBA to build new capabilities into Excel and to perform tasks that integrate Excel with other Office applications such as Microsoft Access 2010. • For example, you could develop new algorithms to analyze your data, then use the charting capabilities in Excel to display the results.
  • 61. 60 Example: A modified macro for processing Belgium Database http://bpp.economie.fgov.be/fo-eregister- view/application?lng=fr&number=EP2214636
  • 66. 65
  • 67. 66 PREPARED BY – SANGITHA V JATIN MISHRA SPECIAL CREDITS – RAJENDIRAN SUNDARAVEL

Editor's Notes

  • #55: Explain briefly about the process