Excel formula if even numbers. How to highlight even and odd numbers in different colors in Excel

So, I'll start my story with even numbers. What are the even numbers? Any integer that can be divisible by two without a remainder is considered even. In addition, even numbers end with one of the given numbers: 0, 2, 4, 6, or 8.

For example: -24, 0, 6, 38 are all even numbers.

m = 2k is a general formula for writing even numbers, where k is an integer. This formula may be needed to solve many problems or equations in primary school.

There is another kind of numbers in the vast realm of mathematics - odd numbers. Any number that cannot be divided by two without a remainder, and when divided by two, the remainder is equal to one, it is customary to call it odd. Any of them ends with one of these numbers: 1, 3, 5, 7, or 9.

An example of odd numbers: 3, 1, 7, and 35.

n = 2k + 1 is a formula that can be used to write down any odd numbers, where k is an integer.

Add and subtract even and odd numbers

There is a certain pattern in the addition (or subtraction) of even and odd numbers. We presented it using the table below, in order to make it easier for you to understand and remember the material.

Operation

Result

Example

Even + Even

Even + Odd

Odd

Odd + Odd

Even and odd numbers will behave the same if you subtract rather than add them.

Multiplication of even and odd numbers

When multiplying, even and odd numbers behave naturally. You will know in advance whether the result will be odd or even. The table below shows all possible options for better assimilation of information.

Operation

Result

Example

Even * Even

Even Odd

Odd * Odd

Odd

Now let's look at fractional numbers.

Decimal notation

Decimal fractions are numbers with a denominator of 10, 100, 1000, and so on, which are written without a denominator. The whole part is separated from the fractional part with a comma.

For example: 3.14; 5.1; 6,789 is everything

Various mathematical operations can be performed with decimal fractions, such as comparison, addition, subtraction, multiplication, and division.

If you want to equalize two fractions, first equalize the number of decimal places by assigning zeros to one of them, and then, discarding the comma, compare them as whole numbers. Let's look at an example. Let's compare 5.15 and 5.1. First, let's equalize the fractions: 5.15 and 5.10. Now let's write them as integers: 515 and 510, therefore, the first number is greater than the second, which means 5.15 is more than 5.1.

If you want to add two fractions, follow this simple rule: start at the end of the fraction and add first (for example) hundredths, then tenths, then whole. With this rule, you can easily subtract and multiply decimal fractions.

But you need to divide fractions as whole numbers, counting at the end where you need to put a comma. That is, first divide the whole part, and then the fractional part.

Decimal fractions should also be rounded. To do this, select the digit to which you want to round the fraction, and replace the corresponding number of digits with zeros. Keep in mind that if the digit following this digit was in the range from 5 to 9 inclusive, then the last digit that remained is increased by one. If the digit following this digit was in the range from 1 to 4 inclusive, then the last remaining one is not changed.

When you need to prepare various kinds of reports, sometimes there is a need to highlight all paired and unpaired numbers in different colors. To solve this problem, the most rational way is conditional formatting.

How to find even numbers in Excel

A set of even and odd numbers that should be automatically highlighted in different colors:

Suppose we need to highlight paired numbers in green, and unpaired ones in blue.



The two formulas differ only in comparison operators before the value 0. Close the rules manager window by clicking the OK button.

As a result, we have cells that contain an unpaired number have a blue fill color, and cells with paired numbers have a green fill color.



Remaining function in Excel to find even and odd numbers

Function = REST () returns the remainder of the division of the first argument by the second. In the first argument, we specify a relative reference, since the data is taken from each cell of the selected range. In the first rule of conditional formatting, we specify the operator equal = 0. Since any paired number divided by 2 (the second operator) has a remainder of division 0. If a paired number is in a cell, the formula returns TRUE and the appropriate format is assigned. In the formula of the second rule, we use the “unequal” operator 0. Thus, we highlight the odd numbers in blue in Excel. That is, the principle of operation of the second rule is inversely proportional to the first rule.

Excel for Office 365 Excel for Office 365 for Mac Excel for the web Excel 2019 Excel 2016 Excel 2019 for Mac Excel 2013 Excel 2010 Excel 2007 Excel 2016 for Mac Excel for Mac 2011 Excel Starter 2010 Less

This article describes the formula syntax and usage of the function EVERYTHING in Microsoft Excel.

Description

Returns TRUE if the number is even and FALSE if the number is odd.

Syntax

EVEN (number)

The arguments to the EVEN function are described below.

    Number Required. The value to check. If the number is not an integer, it is truncated.

Remarks

If number is nonnumeric, EVEN returns the #VALUE! Error value.

Example

Copy the sample data from the following table and paste it into cell A1 of a new Excel worksheet. To display the results of formulas, select them and press F2, and then press Enter. Change the width of the columns as needed to see all the data.

· Even numbers are those that are divisible by 2 without a remainder (for example, 2, 4, 6, etc.). Each such number can be written as 2K by choosing a suitable integer K (for example, 4 = 2 x 2, 6 = 2 x 3, etc.).

· Odd numbers are those that, when divided by 2, give a remainder of 1 (for example, 1, 3, 5, etc.). Each such number can be written in the form 2K + 1, choosing a suitable integer K (for example, 3 = 2 x 1 + 1, 5 = 2 x 2 + 1, etc.).

  • Addition and Subtraction:
    • Heven ± H even = H even
    • Heven ± N even = N odd
    • Neven ± H even = N odd
    • Neven ± N even = H even
  • Multiplication:
    • Heven × H even = H even
    • Heven × N even = H even
    • Nodd × N even = N odd
  • Division:
    • Heven / H even - it is impossible to unambiguously judge the parity of the result (if the result integer, then it can be either even or odd)
    • Heven / N odd --- if the result integerthen it H even
    • Neven / H even - the result cannot be an integer, and therefore have parity attributes
    • Neven / N odd --- if the result integerthen it N odd

The sum of any number of even numbers is even.

The sum of an odd number of odd numbers is odd.

The sum of an even number of odd numbers is even.

The difference of two numbers has the same parity as their sum.
(ex. 2 + 3 = 5 and 2-3 = -1 are both odd)

Algebraic (with + or - signs) sum of integers It has the same parity as their sum.
(ex. 2-7 + (- 4) - (- 3) = - 6 and 2 + 7 + (- 4) + (- 3) = 2 are both even)


The idea of ​​parity has many different uses. The simplest ones are:

1. If in some closed chain objects of two types alternate, then their even number (and equally of each type).

2. If in some chain objects of two types alternate, and the beginning and end of the chain are of different types, then there is an even number of objects in it, if the beginning and end of the same kind, then an odd number. (an even number of objects corresponds to an odd number of transitions between them and vice versa !!! )

2. ". If an object alternates between two possible states, and the initial and final states different, then the periods of the object's stay in one state or another - even number, if the initial and final states coincide, then odd... (reformulation of item 2)

3. Conversely: by the parity of the length of the alternating chain, you can find out whether it is of the same or different types, its beginning and end.

3 ". Conversely, by the number of periods the object is in one of the two possible alternating states, one can find out whether the initial state coincides with the final one. (Reformulation of item 3)

4. If objects can be paired, then their number is even.

5. If for some reason it was possible to divide an odd number of objects into pairs, then some of them will be a pair to itself, and such an object may not be one (but there is always an odd number of them).

(!) All these considerations can be inserted into the text of the solution to the problem at the Olympiad as obvious statements.

Examples:

Objective 1. On the plane there are 9 gears connected in a chain (the first with the second, the second with the third ... the 9th with the first). Can they rotate at the same time?

Solution: No, they cannot. If they could rotate, then in a closed chain two types of gears would alternate: rotating clockwise and counterclockwise (for solving the problem it does not matter, in which one direction the first gear rotates ! ) Then there should be an even number of gears in total, and there are 9 of them ?! h.i. etc. (the sign "?!" denotes the receipt of a contradiction)

Objective 2. Numbers from 1 to 10 are written in a row. Is it possible to put + and - signs between them to get an expression equal to zero?
Solution: No. Parity of the resulting expression always will match parity sums 1 + 2 + ... + 10 = 55, i.e. sum will always be odd ... Is 0 an even number ?! h.t.d.

A bit of theory
Among the olympiad problems for grades 5-6, a special group is usually made up of those where it is required to use the properties of evenness (oddness) of numbers. These properties, simple and obvious in themselves, are easily memorized or deduced, and often schoolchildren do not have any difficulties in their study. But sometimes it is not easy to apply these properties and, most importantly, to guess what exactly they need to be applied for this or that proof. Let's list these properties here.


Considering problems with students in which these properties should be used, one cannot but consider those for the solution of which it is important to know the formulas for even and odd numbers. The experience of teaching these formulas to fifth and sixth graders shows that many of them did not even think that any even number, like an odd one, can be expressed by a formula. Methodologically, it is useful to puzzle the student with a question to write the formula for an odd number first. The fact is that the formula for an even number looks clear and obvious, and the formula for an odd number is a kind of consequence of the formula for an even number. And if a student, in the process of learning new material for himself, thinks about it, having paused for this, then he will rather remember both formulas than if he starts with an explanation from the formula of an even number. Since an even number is the number that is divisible by 2, it can be written as 2n, where n is an integer, and odd is, respectively, as 2n + 1.

Below are the most simple odd / even problems that can be useful to consider as an easy warm-up.

Tasks

1) Prove that you cannot pick up 5 odd numbers that add up to 100.

2) There are 9 sheets of paper. Some of them were torn into 3 or 5 pieces. Some of the formed parts were again torn into 3 or 5 parts and so on several times. Can you get 100 pieces after a few steps?

3) Is the sum of all natural numbers from 1 to 2019 even or odd?

4) Prove that the sum of two consecutive odd numbers is divisible by 4.

5) Is it possible to connect 13 cities with roads so that exactly 5 roads go out from each city?

6) The headmaster of the school wrote in his report that there are 788 students in the school, with 225 more boys than girls. But the checking inspector immediately reported that a mistake had been made in the report. How did he reason?

7) Four numbers are written down: 0; 0; 0; 1. In one move, it is allowed to add 1 to any two of these numbers. Is it possible to get 4 identical numbers in several moves?

8) The chess knight left cell a1 and came back after a few moves. Prove that he made an even number of moves.

9) Can a closed chain of 2017 square tiles be folded in the manner shown in the picture?

10) Is it possible to represent the number 1 as a sum of fractions

11) Prove that if the sum of two numbers is an odd number, then the product of these numbers will always be an even number.

12) The numbers a and b are integers. It is known that a + b = 2018. Can 7a + 5b equal 7891?

13) The parliament of a country has two chambers with an equal number of deputies. All deputies took part in voting on an important issue. At the end of the voting, the Speaker of the Parliament said that the proposal was accepted by a majority of 23 votes, and there were no abstentions. Then one of the deputies said that the results were falsified. How did he guess?

14) There are several points on the straight line. A point was placed between two adjacent points. And so they put points further. After the point was counted. Can the number of points be 2018?

15) Petya has 100 rubles in one bill, and Andrey has full pockets of coins of 2 and 5 rubles. In how many ways can Andrey change Petya's bill?

16) Write down five numbers in a line so that the sum of any two adjacent numbers is odd, and the sum of all numbers is even.

17) Is it possible to write six numbers in a line so that the sum of any two adjacent numbers is even, and the sum of all numbers is odd?

18) In the fencing section, there are 10 times more boys than girls, while there are no more than 20 people in the section. Will they be able to pair up? Will they be able to pair up if there are 9 times more boys than girls? And if 8 times more?

19) Ten boxes contain sweets. In the first - 1, in the second - 2, in the third - 3, etc., in the tenth - 10. Petya is allowed to add three candies to any two boxes in one move. Will Petya be able to equalize the number of candies in the boxes in a few moves? Can Petya equalize the number of chocolates in the boxes by placing three candies in two boxes, if there are 11 boxes initially?

20) 25 boys and 25 girls sit at a round table. Prove that someone sitting at the table has both neighbors of the same sex.

21) Masha and several fifth-graders stood in a circle, holding hands. It turned out that everyone was holding either two boys or two girls by the hand. If there are 10 boys in a circle, how many girls are there?

22) There are 11 gears on the plane, connected in a closed chain, and the 11th is connected to the 1st. Can all gears rotate at the same time?

23) Prove that the fraction is an integer for any natural number n.

24) There are 9 coins on the table, and one of them is upside-down, the others - upside-down. Can all coins be put upside down if two coins are allowed to flip at the same time?

25) Is it possible to arrange 25 natural numbers in a 5x5 table so that in all rows the sums are even, and in all columns - odd?

26) The grasshopper jumps in a straight line: the first time - 1 cm, the second time - 2 cm, the third time - 3 cm, etc. Can he return to his old place after 25 jumps?

27) The snail crawls along the plane at a constant speed, turning at right angles every 15 minutes. Prove that she can return to the starting point only after an integer number of hours.

28) Numbers from 1 to 2000 are written in a row. Is it possible to swap numbers through one, rearrange them in reverse order?

29) There are 8 prime numbers written on the board, each of which is more than two. Could their sum be 79?

30) Masha and her friends stood in a circle. Both neighbors of either child are of the same sex. Boys 5, how many girls?

Loading ...Loading ...