• About
  • Disclaimer
  • Privacy Policy
  • Contact Us
Wednesday, September 27, 2023
Tech Fashion Web
  • Home
  • Fashion
    • Footwear
    • Culture
  • Technology
    • Tech Solution
    • Website Design
    • Cyber Security
    • Software
  • Business
  • Digital Marketing
    • SEO
    • Social Media
  • Travel
  • Entertainment
    • Music
    • Celebrity
  • Health
    • Food
  • lifestyle
    • Home
  • More
    • Gaming
    • Gadgets
    • Education
    • Electronics
    • Gadgets
    • Reviews
    • Law
No Result
View All Result
  • Home
  • Fashion
    • Footwear
    • Culture
  • Technology
    • Tech Solution
    • Website Design
    • Cyber Security
    • Software
  • Business
  • Digital Marketing
    • SEO
    • Social Media
  • Travel
  • Entertainment
    • Music
    • Celebrity
  • Health
    • Food
  • lifestyle
    • Home
  • More
    • Gaming
    • Gadgets
    • Education
    • Electronics
    • Gadgets
    • Reviews
    • Law
No Result
View All Result
Tech Fashion web
No Result
View All Result
How to return a column of n consecutive values in Microsoft Excel

How to return a column of n consecutive values in Microsoft Excel

by Tech Fashion
July 5, 2022
in Technology
0
325
SHARES
2.5k
VIEWS
Share on FacebookShare on Twitter


Image: PixieMe/Adobe Stock

Into the fill handle Microsoft Excel meets most serial listing requirements, and it’s one of the first features users learn to use. By serial I mean a list of sequential values, such as 1, 2, 3, 4 and so on. Microsoft Excel refers to these lists as a series.

TO SEE: Windows, Linux, and Mac Commands Everyone Should Know (Free PDF) (TechRepublic)

As powerful as it is, it can’t handle every series list you need. Let’s assume you need a sequence where each serial value is repeated n times. If n is 5, the list would be 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3 and so on. In this tutorial, I’ll show you how to combine two simple Excel functions, ROW() and ROUNDUP(), to return a sequence of n consecutive values.

I use Microsoft 365 on a Windows 10 64-bit system, but you can use earlier versions. Microsoft Excel for the web supports both features. You can download the demo .xls and .xlsx files for this Excel tutorial.

Using ROW() and ROUNDUP() together in Excel

The expression we’ll be using combines Excel’s ROW() and ROUNDUP() functions. Let’s learn a bit about these two features before using them.

Excel’s ROW() function returns the row number of a reference, using the syntax ROW([reference]) where reference is optional. If omitted, ROW() returns the row number of the current cell. If reference is a vertical range, ROW() returns the row numbers in a vertical array. For example =ROW() entered in C2 returns 2. While ROW(D2:D5) returns the values ​​2, 3, 4, and 5 in a column, as shown in Figure A.

Image A

ROW() returns an array of values ​​equal to the corresponding row number.

We also use Excel’s ROUND() function, which rounds a value up, away from 0. This function uses the following syntax ROUND(number, num_digits) where Excel requires both arguments. Number can be any real number or a reference to a number.

num_digits is the number of digits you want to round to the number. For example, Figure B shows that this function rounds the number 2 up with several decimal values. You can change the results by changing the num_digits argument, which in this case is 1.

Figure B

ROUNDUP() rounds up to the specified number.

Since num_digits is 1, ROUNDUP() returns a single decimal digit when rounding warrants. If num_digits were 2, the function would return two decimal digits where necessary.

None of these functions seem to support a list of serial values, but combined that is exactly what they do.

How to return a certain number of consecutive numbers in Excel

By combining ROW() and ROUND() with a number of input values, you can create a very flexible sequential numbering function. You’ve probably already considered dividing by n, which is part of the solution, but it just doesn’t work, as you can see in Figure C. In this case, n is 5, so 1/5 is .20 . 2/5 is .40, and so on.

Figure C

Start by dividing ROW() by n.

This is where ROUNDUP() comes in. Figure D shows the results of using ROUNDUP() on the simple expression ROW()/n.

Figure D

Add ROUNDUP() to force decimal values ​​to integers.

Let’s evaluate the expression in row 1:

=ROUNDUP(ROW()/5,0)

=ROUNDUP(1/5,0)

=ROUNDUP(0.2,0)

1

The argument num_digit, 0 returns only integers, and the nearest integer to .2, rounding up is 1. Rows 1 through 5 will also return 1. Now let’s look at how the function evaluates in row 6:

=ROUNDUP(ROW()/5,0)

=ROUNDUP(6/5,0)

=ROUNDUP(1.2,0)

2

The expression works as required, but is not flexible enough because it always returns a set of 5 serial values. Fortunately, we can solve that by adding input values.

Add input values ​​to make expression more flexible in Excel

So far, the expression returns consecutive integers in groups of 5, but what if you want to change this expression so that n is really n? The addition of an input value makes this expression flexible enough to handle this request.

Figure E shows the simple setup. C1 is the input value for n. If C1 is empty, nothing happens because the IFERROR() function hides the division by 0 error. This feature isn’t necessary, but you probably don’t want to display a list of error values ​​- that’s up to you.

Digits E

Add an input value for expression n.

Entering 5 in C1 makes the expressions in E1:E10 — =IFERROR(ROUNDUP(ROW()/$C$1,0),"") – return the two groups 1s and 2s we saw earlier. Change the value in C1 to 2 and the expression returns a list of five groups as shown in Figure F. If you enter 1 for n, the expression returns 1, 2, 3, 4 and so on.

Figure F

Change the n input value in C1 to change the grouped list of consecutive values.

The input value can be any integer, positive or negative.

This isn’t the only way to get a list of n consecutive values, but it’s quick and easy.



Source link

Share130Tweet81Share33
Previous Post

4 ways to multiply in Microsoft Excel

Next Post

Get two drones for the price of one

Tech Fashion

Tech Fashion

Related Posts

Which tool is best for your business?
Technology

Which tool is best for your business?

by Tech Fashion
March 24, 2023
LG Will Spend $5.5 Billion on a Battery Factory in Arizona
Technology

LG Will Spend $5.5 Billion on a Battery Factory in Arizona

by Tech Fashion
March 24, 2023
Intel Announces New vPro Platform Running on 13th Generation Core
Technology

Intel Announces New vPro Platform Running on 13th Generation Core

by Tech Fashion
March 24, 2023
Beat the roaming charges with this eSIM
Technology

Beat the roaming charges with this eSIM

by Tech Fashion
March 23, 2023
Next Post
Get two drones for the price of one

Get two drones for the price of one

Lawmakers Ask F.T.C. Chair to Investigate TikTok’s Data Practices

Lawmakers Ask F.T.C. Chair to Investigate TikTok’s Data Practices

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Categories

  • Business (2)
  • Celebrity (10)
  • Culture (8)
  • Education (8)
  • Entertainment (3)
  • Fashion (12)
  • Food (7)
  • Footwear (7)
  • Health (6)
  • Lifestyle (14)
  • Music (6)
  • Social Media (2)
  • Software (4)
  • Tech Solution (1)
  • Technology (1,884)
  • Travel (12)
  • Website Design (2)

Recent.

Which tool is best for your business?

Which tool is best for your business?

March 24, 2023
LG Will Spend $5.5 Billion on a Battery Factory in Arizona

LG Will Spend $5.5 Billion on a Battery Factory in Arizona

March 24, 2023
Intel Announces New vPro Platform Running on 13th Generation Core

Intel Announces New vPro Platform Running on 13th Generation Core

March 24, 2023
Tech Fashion Web

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Category

  • Business
  • Celebrity
  • Culture
  • Education
  • Entertainment
  • Fashion
  • Food
  • Footwear
  • Health
  • Lifestyle
  • Music
  • Social Media
  • Software
  • Tech Solution
  • Technology
  • Travel
  • Website Design

Recent Posts

  • Which tool is best for your business? March 24, 2023
  • LG Will Spend $5.5 Billion on a Battery Factory in Arizona March 24, 2023
  • Intel Announces New vPro Platform Running on 13th Generation Core March 24, 2023

Contact Us

    © 2021 techfashionweb.com . All rights reserved.

    No Result
    View All Result
    • Home
    • Fashion
      • Footwear
      • Culture
    • Technology
      • Tech Solution
      • Website Design
      • Cyber Security
      • Software
    • Business
    • Digital Marketing
      • SEO
      • Social Media
    • Travel
    • Entertainment
      • Music
      • Celebrity
    • Health
      • Food
    • lifestyle
      • Home
    • More
      • Gaming
      • Gadgets
      • Education
      • Electronics
      • Gadgets
      • Reviews
      • Law

    © 2021 techfashionweb.com . All rights reserved.