C (Programming Language)

C is a procedural programming language. It was initially developed by Dennis Ritchie in the year 1972. It was mainly developed as a system programming language to write an operating system. The main features of C language include low-level access to memory, a simple set of keywords, and clean style, these features make C language suitable for system programmings like an operating system or compiler development.

Many later languages have borrowed syntax/features directly or indirectly from C language. Like syntax of Java, PHP, JavaScript, and many other languages are mainly based on C language. C++ is nearly a superset of C language (There are few programs that may compile in C, but not in C++).

Beginning with C programming:

  1. Structure of a C program

After the above discussion, we can formally assess the structure of a C program. By structure, it is meant that any program can be written in this structure only. Writing a C program in any other structure will hence lead to a Compilation Error.

The structure of a C program is as follows:

The components of the above structure are:

(i) Header Files Inclusion: The first and foremost component is the inclusion of the Header files in a C program.

A header file is a file with extension .h which contains C function declarations and macro definitions to be shared between several source files.

Some of C Header files:

  • h – Defines several useful types and macros.
  • h – Defines exact width integer types.
  • h – Defines core input and output functions
  • h – Defines numeric conversion functions, pseudo-random network generator, memory allocation
  • h – Defines string handling functions
  • h – Defines common mathematical functions

Syntax to include a header file in C:

#include

(ii) Main Method Declaration: The next part of a C program is to declare the main() function. The syntax to declare the main function is:

Syntax to Declare main method:

int main()

{}

(iii) Variable Declaration: The next part of any C program is the variable declaration. It refers to the variables that are to be used in the function. Please note that in the C program, no variable can be used without being declared. Also in a C program, the variables are to be declared before any operation in the function.

Example:

int main()

{

    int a;

.

.

(iv) Body: Body of a function in C program, refers to the operations that are performed in the functions. It can be anything like manipulations, searching, sorting, printing, etc.

Example:

int main()

{

    int a;

    printf(“%d”, a);

.

.

(v) Return Statement: The last part in any C program is the return statement. The return statement refers to the returning of the values from a function. This return statement and return value depend upon the return type of the function. For example, if the return type is void, then there will be no return statement. In any other case, there will be a return statement and the return value will be of the type of the specified return type.

Example:

int main()

{

    int a;

    printf(“%d”, a);

    return 0;

}

  1. Writing first program

Following is first program in C

#include <stdio.h>

int main(void)

{

    printf(“GeeksQuiz”);

    return 0;

}

Let us analyze the program line by line.

Line 1: [ #include <stdio.h> ] In a C program, all lines that start with # are processed by preprocessor which is a program invoked by the compiler. In a very basic term, preprocessor takes a C program and produces another C program. The produced program has no lines starting with #, all such lines are processed by the preprocessor. In the above example, preprocessor copies the preprocessed code of stdio.h to our file. The .h files are called header files in C. These header files generally contain declaration of functions. We need stdio.h for the function printf() used in the program.

Line 2 [ int main(void) ] There must to be starting point from where execution of compiled C program begins. In C, the execution typically begins with first line of main(). The void written in brackets indicates that the main doesn’t take any parameter (See this for more details). main() can be written to take parameters also. We will be covering that in future posts.

The int written before main indicates return type of main(). The value returned by main indicates status of program termination. See this post for more details on return type.

Line 3 and 6: [ { and } ] In C language, a pair of curly brackets define a scope and mainly used in functions and control statements like if, else, loops. All functions must start and end with curly brackets.

Line 4 [ printf(“GeeksQuiz”); ] printf() is a standard library function to print something on standard output. The semicolon at the end of printf indicates line termination. In C, semicolon is always used to indicate end of statement.

Line 5 [ return 0; ] The return statement returns the value from main(). The returned value may be used by operating system to know termination status of your program. The value 0 typically means successful termination.

  1. How to excecute the above program?

Inorder to execute the above program, we need to have a compiler to compile and run our programs. There are certain online compilers like https://ide.geeksforgeeks.org/, http://ideone.com/ or http://codepad.org/ that can be used to start C without installing a compiler.

Windows: There are many compilers available freely for compilation of C programs like Code Blocks  and Dev-CPP.   We strongly recommend Code Blocks.

Linux: For Linux, gcc comes bundled with the linux,  Code Blocks can also be used with Linux.

Data Types, Variable and Constant in C

Variables

If you declare a variable in C (later on we talk about how to do this), you ask the operating system for a piece of memory. This piece of memory you give a name and you can store something in that piece of memory (for later use). There are two basic kinds of variables in C which are numeric and character.

Numeric variables

Numeric variables can either be of the type integer (int) or of the type real (float). Integer (int) values are whole numbers (like 10 or -10). Real (float) values can have a decimal point in them. (Like 1.23 or -20.123).

Character variables

Character variables are letters of the alphabet, ASCII characters or numbers 0-9. If you declare a character variable you must always put the character between single quotes (like so ‘A’ ). So remember a number without single quotes is not the same as a character with single quotes.

Constants

The difference between variables and constants is that variables can change their value at any time but constants can never change their value. (The constants value is lockedfor the duration of the program). Constants can be very useful, Pi for instance is a good example to declare as a constant.

Data Types

So you now know that there are three types of variables: numeric – integer, numeric-real and character. A variable has a type-name, a type and a range (minimum / maximum). In the following table you can see the type-name, type and range:

Type-name Type Range
int                   Numeric – Integer -32 768 to 32 767
Short Numeric – Integer -32 768 to 32 767
Long Numeric – Integer -2 147 483 648 to 2 147 483 647
Float Numeric – Real 1.2 X 10-38 to 3.4 X 1038
Double Numeric – Real 2.2 X 10-308 to 1.8 X 10308
Char Character All ASCII characters

C Programming Expression

C Programming Expression

  • In programming, an expression is any legal combination of symbols that represents a value.
  • C Programming Provides its own rules of Expression, whether it is legal expression or illegal expression. For example, in the C language x+5 is a legal expression.
  • Every expression consists of at least one operand and can have one or more operators.
  • Operands are values and Operators are symbols that represent particular actions.

Valid C Programming Expression

C Programming code gets compiled firstly before execution. In the different phases of compiler, c programming expression is checked for its validity.

Expressions Validity
a + b Expression is valid since it contain + operator which is binary operator
+ + a + b Invalid Expression

Priority and Expression

In order to solve any expression we should have knowledge of C Programming Operators and their priorities.

Types of Expression

In Programming, different verities of expressions are given to the compiler. Expressions can be classified on the basis of Position of Operators in an expression:

Type   Explanation  Example
Infix Expression in which Operator is in between Operands a + b
Prefix Expression in which Operator is written before Operands + a b
Postfix Expression in which Operator is written after Operands a b +

Examples of Expression

Now we will be looking into some of the C Programming Expressions, Expression can be created by combining the operators and operands

Each of the expression results into the some resultant output value. Consider few expressions in below table

Expression Examples, Explanation

n1 + n2,This is an expression which is going to add two numbers and we can assign the result of addition to another variable.

x = y,This is an expression which assigns the value of right hand side operand to left side variable

v = u + a * t,We are multiplying two numbers and result is added to ‘u’ and total result is assigned to v

x <= y,This expression will return Boolean value because comparison operator will give us output either true or false ++j,This is expression having pre increment operator\, it is used to increment the value of j before using it in expression [/table]

Assignment Operator in C Programming, Dynamic Data Structure in C – Pointers

Assignment Operator in C Programming Language:

  • Assignment Operator is used to assign value to an variable.
  • Assignment Operator is denoted by equal to sign
  • Assignment Operator is binary operator which operates on two operands.
  • Assignment Operator have Two Values: L-Value and R-Value. Operator copies R-Value into L-Value.
  • Assignment Operator have lower precedence than all available operators but has higher precedence than comma Operator.

Dynamic Data Structure in C – Pointers

For programs dealing with large sets of data, it would be a nuisance to have to name every structure variable containing every piece of data in the code — for one thing, it would be inconvenient to enter new data at run time because you would have to know the name of the variable in which to store the data when you wrote the program. For another thing, variables with names are permanent — they cannot be freed and their memory reallocated, so you might have to allocate an impractically large block of memory for your program at compile time, even though you might need to store much of the data you entered at run time temporarily.

Fortunately, complex data structures are built out of dynamically allocated memory, which does not have these limitations. All your program needs to do is keep track of a pointer to a dynamically allocated block, and it will always be able to find the block.

A complex data structure is usually built out of the following components:

  • Nodes: Dynamically-allocated blocks of data, usually structures.
  • Links: Pointers from nodes to their related nodes.
  • Root: The node where a data structure starts, also known as the root node. The address of the root of a data structure must be stored explicitly in a C variable, or else you will lose track of it.

There are some advantages to the use of dynamic storage for data structures:

  • As mentioned above, since memory is allocated as needed, we don’t need to declare how much we shall use in advance.
  • Complex data structures can be made up of lots of “lesser” data structures in a modular way, making them easier to program.
  • Using pointers to connect structures means that they can be re-connected in different ways as the need arises. (Data structures can be sorted, for example.)

Structure and Unions, User Defined Variables

Similarities between Structure and Union

  1. Both are user-defined data types used to store data of different types as a single unit.
  2. Their members can be objects of any type, including other structures and unions or arrays. A member can also consist of a bit field.
  3. Both structures and unions support only assignment = and sizeof operators. The two structures or unions in the assignment must have the same members and member types.
  4. A structure or a union can be passed by value to functions and returned by value by functions. The argument must have the same type as the function parameter. A structure or union is passed by value just like a scalar variable as a corresponding parameter.
  5. Operator is used for accessing members.

Structure and union both are user defined data types which contains variables of different data types. Both of them have same syntax for definition, declaration of variables and for accessing members. Still there are many difference between structure and union. In this tutorial we will take a look on those differences.

Difference between Structure and Union

Structure Union

In structure each member get separate space in memory. Take below example.

struct student { int rollno; char gender; float marks; }s1;

The total memory required to store a structure variable is equal to the sum of size of all the members. In above case 7 bytes (2+1+4) will be required to store structure variable s1.

In union, the total memory space allocated is equal to the member with largest size. All other members share the same memory space. This is the biggest difference between structure and union.

union student { int rollno; char gender; float marks; }s1;

In above example variable marks is of float type and have largest size (4 bytes). So the total memory required to store union variable s1 is 4 bytes.

We can access any member in any sequence.

s1.rollno = 20; s1.marks = 90.0; printf(“%d”,s1.rollno);

The above code will work fine but will show erroneous output in the case of union. We can access only that variable whose value is recently stored.

s1.rollno = 20; s1.marks = 90.0; printf(“%d”,s1.rollno);

The above code will show erroneous output. The value of rollno is lost as most recently we have stored value in marks. This is because all the members share same memory space.

All the members can be initialized while declaring the variable of structure. Only first member can be initialized while declaring the variable of union. In above example we can initialize only variable rollno at the time of declaration of variable.

User Defined Variables

User-defined variables are variables which can be created by the user and exist in the session. This means that no one can access user-defined variables that have been set by another user, and when the session is closed these variables expire. However, these variables can be shared between several queries and stored programs.

User-defined variables names must be preceded by a single at character (@). While it is safe to use a reserved word as a user-variable name, the only allowed characters are ASCII letters, digits, dollar sign ($), underscore (_) and dot (.). If other characters are used, the name can be quoted in one of the following ways:

  • @`var_name`
  • @’var_name’
  • @”var_name”

These characters can be escaped as usual.

User-variables names are case insensitive, though they were case sensitive in MySQL 4.1 and older versions.

User-defined variables cannot be declared. They can be read even if no value has been set yet; in that case, they are NULL. To set a value for a user-defined variable you can use:

SET statement;

:= operator within a SQL statement;

SELECT … INTO.

Since user-defined variables type cannot be declared, the only way to force their type is using CAST() or CONVERT():

SET @str = CAST(123 AS CHAR(5));

If a variable has not been used yet, its value is NULL:

SELECT @x IS NULL;

+————+

| @x IS NULL |

+————+

|          1 |

+————+

It is unsafe to read a user-defined variable and set its value in the same statement (unless the command is SET), because the order of these actions is undefined.

User-defined variables can be used in most MariaDB’s statements and clauses which accept an SQL expression. However there are some exceptions, like the LIMIT clause.

They must be used to PREPARE a prepared statement:

@sql = ‘DELETE FROM my_table WHERE c>1;’;

PREPARE stmt FROM @sql;

EXECUTE stmt;

DEALLOCATE PREPARE stmt;

Another common use is to include a counter in a query:

SET @var = 0;

SELECT a, b, c, (@var:=@var+1) AS counter FROM my_table;

File Handling, C – Preprocessors

File Handling in C

In programming, we may require some specific input data to be generated several numbers of times. Sometimes, it is not enough to only display the data on the console. The data to be displayed may be very large, and only a limited amount of data can be displayed on the console, and since the memory is volatile, it is impossible to recover the programmatically generated data again and again. However, if we need to do so, we may store it onto the local file system which is volatile and can be accessed every time. Here, comes the need of file handling in C.

File handling in C enables us to create, update, read, and delete the files stored on the local file system through our C program. The following operations can be performed on a file.

  • Creation of the new file
  • Opening an existing file
  • Reading from the file
  • Writing to the file
  • Deleting the file

C – Preprocessors

The C Preprocessor is not a part of the compiler, but is a separate step in the compilation process. In simple terms, a C Preprocessor is just a text substitution tool and it instructs the compiler to do required pre-processing before the actual compilation. We’ll refer to the C Preprocessor as CPP.

All preprocessor commands begin with a hash symbol (#). It must be the first nonblank character, and for readability, a preprocessor directive should begin in the first column.

The following section lists down all the important preprocessor directives:

  • #define: Substitutes a preprocessor macro.
  • #include: Inserts a particular header from another file.
  • #undef: Undefines a preprocessor macro.
  • #ifdef: Returns true if this macro is defined
  • #ifndef: Returns true if this macro is not defined
  • #if: Tests if a compile time condition is true
  • #else: The alternative for #if
  • #elif: #else and #if in one statement
  • #endif: Ends preprocessor conditional
  • #error: Prints error message on stderr.
  • #pragma: Issues special commands to the compiler, using a standardized method

C – Standard Library

The C standard library or libc is the standard library for the C programming language, as specified in the ANSI C standard. It was developed at the same time as the C library POSIX specification, which is a superset of it. Since ANSI C was adopted by the International Organization for Standardization, the C standard library is also called the ISO C library.

The C standard library provides macros, type definitions and functions for tasks such as string handling, mathematical computations, input/output processing, memory management, and several other operating system services.

Implementations of C-Standard Library

Unix-like systems typically have a C library in shared library form, but the header files (and compiler toolchain) may be absent from an installation so C development may not be possible. The C library is considered part of the operating system on Unix-like systems. The C functions, including the ISO C standard ones, are widely used by programs, and are regarded as if they were not only an implementation of something in the C language, but also de facto part of the operating system interface. Unix-like operating systems generally cannot function if the C library is erased. This is true for applications which are dynamically as opposed to statically linked. Further, the kernel itself (at least in the case of Linux) operates independently of any libraries.

On Microsoft Windows, the core system dynamic libraries (DLLs) provide an implementation of the C standard library for the Microsoft Visual C++ compiler v6.0; the C standard library for newer versions of the Microsoft Visual C++ compiler is provided by each compiler individually, as well as redistributable packages. Compiled applications written in C are either statically linked with a C library, or linked to a dynamic version of the library that is shipped with these applications, rather than relied upon to be present on the targeted systems. Functions in a compiler’s C library are not regarded as interfaces to Microsoft Windows.

Many other implementations exist, provided with both various operating systems and C compilers. Some of the popular implementations are the following:

  • BSD libc, implementations distributed under BSD operating systems
  • GNU C Library (glibc), used in GNU Hurd, GNU/kFreeBSD and Linux
  • Microsoft C run-time library, part of Microsoft Visual C++
  • dietlibc, an alternative small implementation of the C standard library (MMU-less)
  • μClibc, a C standard library for embedded μClinux systems (MMU-less)
  • Newlib, a C standard library for embedded systems (MMU-less)
  • klibc, primarily for booting Linux systems
  • musl, another lightweight C standard library implementation for Linux systems
  • Bionic, originally developed by Google for the Android embedded system operating system, derived from BSD libc.

Advantages of Using C library functions

  1. They work

One of the most important reasons you should use library functions is simply because they work. These functions have gone through multiple rigorous testing and are easy to use.

  1. The functions are optimized for performance

Since, the functions are “standard library” functions, a dedicated group of developers constantly make them better. In the process, they are able to create the most efficient code optimized for maximum performance.

  1. It saves considerable development time

Since the general functions like printing to a screen, calculating the square root, and many more are already written. You shouldn’t worry about creating them once again.

  1. The functions are portable

With ever-changing real-world needs, your application is expected to work every time, everywhere. And, these library functions help you in that they do the same thing on every computer.

C – Header Files

A header file is a file with extension .h which contains C function declarations and macro definitions to be shared between several source files. There are two types of header files: the files that the programmer writes and the files that comes with your compiler.

You request to use a header file in your program by including it with the C preprocessing directive #include, like you have seen inclusion of stdio.h header file, which comes along with your compiler.

Including a header file is equal to copying the content of the header file but we do not do it because it will be error-prone and it is not a good idea to copy the content of a header file in the source files, especially if we have multiple source files in a program.

A simple practice in C or C++ programs is that we keep all the constants, macros, system wide global variables, and function prototypes in the header files and include that header file wherever it is required.

Include Syntax

Both the user and the system header files are included using the preprocessing directive #include. It has the following two forms:

#include <file>

This form is used for system header files. It searches for a file named ‘file’ in a standard list of system directories. You can prepend directories to this list with the -I option while compiling your source code.

#include “file”

This form is used for header files of your own program. It searches for a file named ‘file’ in the directory containing the current file. You can prepend directories to this list with the -I option while compiling your source code.

Include Operation

The #include directive works by directing the C preprocessor to scan the specified file as input before continuing with the rest of the current source file. The output from the preprocessor contains the output already generated, followed by the output resulting from the included file, followed by the output that comes from the text after the #include directive. For example, if you have a header file header.h as follows −

char *test (void);

and a main program called program.c that uses the header file, like this −

int x;

#include “header.h”

int main (void) {

   puts (test ());

}

the compiler will see the same token stream as it would if program.c read.

int x;

char *test (void);

int main (void) {

   puts (test ());

}

Once-Only Headers

If a header file happens to be included twice, the compiler will process its contents twice and it will result in an error. The standard way to prevent this is to enclose the entire real contents of the file in a conditional, like this −

#ifndef HEADER_FILE

#define HEADER_FILE

the entire header file file

#endif

This construct is commonly known as a wrapper #ifndef. When the header is included again, the conditional will be false, because HEADER_FILE is defined. The preprocessor will skip over the entire contents of the file, and the compiler will not see it twice.

Computed Includes

Sometimes it is necessary to select one of the several different header files to be included into your program. For instance, they might specify configuration parameters to be used on different sorts of operating systems. You could do this with a series of conditionals as follows −

#if SYSTEM_1

   # include “system_1.h”

#elif SYSTEM_2

   # include “system_2.h”

#elif SYSTEM_3

   …

#endif

But as it grows, it becomes tedious, instead the preprocessor offers the ability to use a macro for the header name. This is called a computed include. Instead of writing a header name as the direct argument of #include, you simply put a macro name there −

#define SYSTEM_H “system_1.h”

#include SYSTEM_H

SYSTEM_H will be expanded, and the preprocessor will look for system_1.h as if the #include had been written that way originally. SYSTEM_H could be defined by your Makefile with a -D option.

Spreadsheet Programs: Microsoft Excel

A spreadsheet is a computer application for organization, analysis and storage of data in tabular form. Spreadsheets were developed as computerized analogs of paper accounting worksheets. The program operates on data entered in cells of a table. Each cell may contain either numeric or text data, or the results of formulas that automatically calculate and display a value based on the contents of other cells. A spreadsheet may also refer to one such electronic document.

Spreadsheet users can adjust any stored value and observe the effects on calculated values. This makes the spreadsheet useful for “what-if” analysis since many cases can be rapidly investigated without manual recalculation. Modern spreadsheet software can have multiple interacting sheets, and can display data either as text and numerals, or in graphical form.

Besides performing basic arithmetic and mathematical functions, modern spreadsheets provide built-in functions for common financial and statistical operations. Such calculations as net present value or standard deviation can be applied to tabular data with a pre-programmed function in a formula. Spreadsheet programs also provide conditional expressions, functions to convert between text and numbers, and functions that operate on strings of text.

Spreadsheets have replaced paper-based systems throughout the business world. Although they were first developed for accounting or bookkeeping tasks, they now are used extensively in any context where tabular lists are built, sorted, and shared.

Microsoft Excel

Microsoft Excel is a spreadsheet developed by Microsoft for Windows, macOS, Android and iOS. It features calculation, graphing tools, pivot tables, and a macro programming language called Visual Basic for Applications. It has been a very widely applied spreadsheet for these platforms, especially since version 5 in 1993, and it has replaced Lotus 1-2-3 as the industry standard for spreadsheets. Excel forms part of the Microsoft Office suite of software.

Microsoft Excel has the basic features of all spreadsheets, using a grid of cells arranged in numbered rows and letter-named columns to organize data manipulations like arithmetic operations. It has a battery of supplied functions to answer statistical, engineering and financial needs. In addition, it can display data as line graphs, histograms and charts, and with a very limited three-dimensional graphical display. It allows sectioning of data to view its dependencies on various factors for different perspectives (using pivot tables and the scenario manager). It has a programming aspect, Visual Basic for Applications, allowing the user to employ a wide variety of numerical methods, for example, for solving differential equations of mathematical physics, and then reporting the results back to the spreadsheet. It also has a variety of interactive features allowing user interfaces that can completely hide the spreadsheet from the user, so the spreadsheet presents itself as a so-called application, or decision support system (DSS), via a custom-designed user interface, for example, a stock analyzer, or in general, as a design tool that asks the user questions and provides answers and reports. In a more elaborate realization, an Excel application can automatically poll external databases and measuring instruments using an update schedule, analyze the results, make a Word report or PowerPoint slide show, and e-mail these presentations on a regular basis to a list of participants. Excel was not designed to be used as a database.

Microsoft allows for a number of optional command-line switches to control the manner in which Excel starts.

Uses of Microsoft Excel

MS Excel is used very widely nowadays by everyone because it is very helpful and it helps in saving a lot of time. It is being used for so many years and it gets upgraded every year with new features. The most impressive thing about MS Excel is that it can be used anywhere for any kind of work. For example, it is used for billing, data management, analysis, inventory, finance, business tasks, complex calculations, etc. One can even do mathematical calculations using this and can also store important data in it in the form of charts or spreadsheets.

MS Excel provides security to your files so that no one else can see your files or ruin them. With the help of MS Excel, you can keep your files password protected. MS Excel can be accessed from anywhere and everywhere. You can even work on MS Excel using mobile if you don’t have laptops. There are so many benefits of using MS Excel that it has become an inevitable part of lives of millions of people. MS Excel has numerous tools and features that make one’s work easy and saves one’s time also.

To use MS Excel to the best of its ability one must know its benefits and advantages. Following are the ten best uses of MS Excel:

  1. Analyzing and storing data

One of the best uses of MS Excel is that you can analyze larger amounts of data to discover trends. With the help of graphs and charts, you can summarize the data and store it in an organized way so that whenever you want to see that data then you can easily see it. It becomes easier for you to store data and it will definitely save a lot of time for you.

Once the data is stored in a systematic way, it can be used easily for multiple purposes. MS Excel makes it easier to implement various operations on the data through various tools that it possesses.

  1. Excel tools make your work easier

There are so many tools of MS Excel that make your work extremely easy and save your time as well. There are wonderful tools for sorting, filtering and searching which all the more make you work easy. If you will combine these tools with tables, pivot tables etc. then you will be able to finish your work in much less time. Multiple elements can be searched easily from large amounts of data to help solve a lot of problems and questions.

  1. Data recovery and spreadsheets

Another best use of MS Excel is that if your data gets lost then you can recover it without much inconvenience. Suppose, there is a businessman who has stored his important data in MS Excel and somehow it gets lost or the file gets damaged then he must not worry as with the new MS Excel XML format one can restore the lost or damaged file data.

The next important use is that there are spreadsheets in MS Excel which also makes your work easy and with the help of new Microsoft MS Excel XML format you can reduce the size of the spreadsheet and make things compact easily.

  1. Mathematical formulas of MS Excel make things easier

Next best use of MS Excel is that it makes easy for you to solve complex mathematical problems in a much simpler way without much manual effort. There are so many formulas in MS Excel and by using these formulas you can implement lots of operations like finding sum, average, etc. on a large amount of data all at once. Therefore, people use MS Excel whenever they have to solve complex mathematical problems or they need to apply simple mathematical functions on tables containing larger data.

  1. Security

The chief use of MS Excel is that it provides security for excel files so people can keep their files safe. All the files of MS Excel can be kept password-protected through visual basic programming or directly within the excel file. People store their important data in the MS Excel so that they can keep their data in an organized way and save their time as well. Almost every person wants his files to be password protected so that no one is able to see them or ruin them so here MS Excel solves this problem very efficiently.

  1. Add sophistication to data presentations

Next use of MS Excel is that it helps you in adding more sophistication to your data presentations which means that you can improve the data bars, you can highlight any specific items that you want to highlight and make your data much more presentable easily.

Suppose you have stored data in MS Excel and you want to highlight something that is important so then you can do that through the various features of data presentations available in MS Excel. You can even make the spreadsheets more attractive on which you have stored data.

  1. Online access

Another use of MS Excel is that it can be accessed online from anywhere and everywhere which means that you can access it from any device and from any location whenever you want. It provides the facility of working conveniently which means that if you don’t have laptops then you can use mobile and do your work easily without any problem. Therefore, due to the large amount of flexibility that MS Excel provides, people like to work on MS Excel so that they can comfortably work without worrying about their device or location.

  1. Keeps data combined at one location

Another interesting use of MS Excel is that you can keep all your data at one location. This will help you in saving your data from getting lost. It will keep all your data in one place and then you will not have to waste your time in searching for the files. So it will save your time and whenever need be, you can look up the categorized and sorted data easily.

  1. Helps businessmen in developing future strategy

You can represent data in the form of charts and graphs so it can help in identifying different trends. With the help of MS Excel, trend lines can be extended beyond graph and therefore, it helps one in analyzing the trends and patterns much easier. In business, it is very important to analyze the popularity of goods or the selling pattern that they follow to maximize sales. MS Excel simplifies this task and helps businessmen grow and maximize profits through the same.

  1. Manage expenses

MS Excel helps in managing expenses. Suppose if a doctor is earning around 50,000 per month then he will make some expenses as well and if he wants to know how much he is exactly spending per month then he can do it with the help of MS Excel easily. He can write his monthly income as well as expenses in the excel tables and then he can get to know that how much he is spending and he can thus, control his expenses accordingly.

There are a lot of benefits of using MS Excel, which is why it is used worldwide by people for performing so many tasks. It not only saves time but also it makes the work easier. It can almost perform every type of task. For example, you can do mathematical calculations and you can also make graphs as well as charts for storing the data. It becomes easy for the businessman to calculate things and store data in it.

You can store a large amount of data in the MS Excel and analyze it as well. It helps in keeping the data combined in one place so that data does not get lost and one does not waste time in finding a particular data. Due to these factors, it has become such a popular software and we have become habitual of using it.

Microsoft Excel (Entering Data, Label, Value, Dates, Formulas and Functions, Cell Reference)

  1. Entering Data

To enter data in Excel, just select a cell and begin typing. You’ll see the text appear both in the cell and in the formula bar above.

To tell Excel to accept the data you’ve typed, press enter. The information will be entered immediately, and the cursor will move down one cell.

You can also press the tab key instead of the enter key. If you press tab, the cursor will move one cell to the right once the information has been entered.

When Excel sees that you are typing into a list, pressing enter at the end of the row will move the cursor down one row and back to the first column.

At any time while you are typing you can press the escape key to cancel. This brings Excel back to the state it was in before you started typing.

When you want to delete information that has already been entered, just select the cells, and press the delete key.

  1. Label

Before you edit: You can add data labels to a bar, column, scatter, area, line, waterfall, histograms, or pie chart.

  • On your computer, open a spreadsheet in Google Sheets.
  • Double-click the chart you want to change.
  • At the right, click Customize.
  • Click Series.
  • Optional: Next to “Apply to,” choose the data series you want to add a label to.
  • Click Data labels.
  • Optional: Under “Position,” choose where you want the data labels to show.
  • Optional: Make changes to the label font.
  1. Value on a Spreadsheet

Spreadsheets are useful at home and in business applications. Spreadsheets make it easy to view and exhibit data in a number of manners. Values are one of the primary types of data used in spreadsheets

Values are numbers entered into spreadsheet cells. If a formula or function returns a number into a cell, this data is also a value.

While values are always numerical, there are several categories that can be considered values, such as currency, dates and times and percentages or fractions.

  1. Dates

When you combine it with other Google Sheets functions, you can use DATE to produce a wide variety of date formulas. One important use for the function is to ensure that Sheets interprets dates correctly, especially if the entered data isn’t in the most useful format.

The DATE function’s primary use is to display a date that combines elements such as year, month, or day from different locations in the worksheet, and to ensure that dates used in calculations are number data instead of text.

The DATE Function’s Syntax and Arguments

A function’s syntax refers to the layout of the function and includes the function’s name, brackets, and arguments.

The syntax for the DATE function is: = DATE(year, month, day).

  • Year – enter the year as a four-digit number (yyyy) or the cell reference to its location in the worksheet.
  • Month – enter the month as a two-digit number (mm) or the cell reference to its location in the worksheet.
  • Day – enter the day as a two-digit number (dd) or the cell reference to its location in the worksheet.
  1. Formulas and Functions

Formula

In Excel, a formula is an expression that operates on values in a range of cells or a cell. For example, =A1+A2+A3, which finds the sum of the range of values from cell A1 to cell A3.

Functions

Functions are predefined formulas in Excel. They eliminate laborious manual entry of formulas while giving them human-friendly names. For example: =SUM(A1:A3). The function sums all the values from A1 to A3.

Five Time-saving Ways to Insert Data into Excel

When analyzing data, there are five common ways of inserting basic Excel formulas. Each strategy comes with its own advantages. Therefore, before diving further into the main formulas, we’ll clarify those methods, so you can create your preferred workflow earlier on.

(i) Simple insertion: Typing a formula inside the cell

Typing a formula in a cell or the formula bar is the most straightforward method of inserting basic Excel formulas. The process usually starts by typing an equal sign, followed by the name of an Excel function.

Excel is quite intelligent in that when you start typing the name of the function, a pop-up function hint will show. It’s from this list you’ll select your preference. However, don’t press the Enter key. Instead, press the Tab key so that you can continue to insert other options. Otherwise, you may find yourself with an invalid name error, often as ‘#NAME?’. To fix it, just re-select the cell, and go to the formula bar to complete your function.

(ii) Using Insert Function Option from Formulas Tab

If you want full control of your functions insertion, using the Excel Insert Function dialogue box is all you ever need. To achieve this, go to the Formulas tab and select the first menu labeled Insert Function. The dialogue box will contain all the functions you need to complete your financial analysis.

(iii) Selecting a Formula from One of the Groups in Formula Tab

This option is for those who want to delve into their favorite functions quickly. To find this menu, navigate to the Formulas tab and select your preferred group. Click to show a sub-menu filled with a list of functions. From there, you can select your preference. However, if you find your preferred group is not on the tab, click on the More Functions option – it’s probably just hidden there.

(iv) Using AutoSum Option

For quick and everyday tasks, the AutoSum function is your go-to option. So, navigate to the Home tab, in the far-right corner, and click the AutoSum option. Then click the caret to show other hidden formulas. This option is also available in the Formulas tab first option after the Insert Function option.

(v) Quick Insert: Use Recently Used Tabs

If you find re-typing your most recent formula a monotonous task, then use the Recently Used menu. It’s on the Formulas tab, a third menu option just next to AutoSum.

  1. Cell

In spreadsheet applications, a cell is a box in which you can enter a single piece of data. The data is usually text, a numeric value, or a formula. The entire spreadsheet is composed of rows and columns of cells. A spreadsheet cell is analogous to a field in database management systems.  Individual cells are usually identified by a column letter and a row number.

  1. Cell Reference

A cell reference in Excel refers to the value of a different cell or cell range on the current worksheet or a different worksheet within the spreadsheet. A cell reference can be used as a variable in a formula.

  1. Format a Worksheet

In Excel, formatting worksheet (or sheet) data is easier than ever. You can use several fast and simple ways to create professional-looking worksheets that display your data effectively. For example, you can use document themes for a uniform look throughout all of your Excel spreadsheets, styles to apply predefined formats, and other manual formatting features to highlight important data.

error: Content is protected !!