Set column values in excel

I have a problem with Excel.
I have added an extra column to my data, and I want to set all the rows of the column equal to the string «Male».

Does anyone know how to achieve this?

Excellll's user avatar

Excellll

12.5k11 gold badges50 silver badges78 bronze badges

asked Oct 28, 2010 at 9:37

GorillaApe's user avatar

1

Enter «Male» in the first cell then select it and all the cells beneath it you want filled, then press Ctrl + D to fill down.

answered Oct 28, 2010 at 9:42

Mike Fitzpatrick's user avatar

Mike FitzpatrickMike Fitzpatrick

16.7k4 gold badges45 silver badges46 bronze badges

3

Asked
12 years, 6 months ago

Viewed
20k times

I have a column. THe column is the number 2 all the way down.

What is the fastest way to make all the cells in this column a 3?

The values are of string datatype I believe.

  • excel

asked Sep 22, 2010 at 15:15

JoJo's user avatar

JoJoJoJo

4,5539 gold badges41 silver badges65 bronze badges

1 Answer

  • Click the first «2» cell
  • Press Control+Shift+DownArrow
  • Press the 3 key
  • Press Control+Enter
  • See if it did what you thought you wanted

answered Sep 22, 2010 at 15:58

Mike Woodhouse's user avatar

Mike WoodhouseMike Woodhouse

51.5k12 gold badges88 silver badges127 bronze badges

1

  • In case that you want to fill a column up to a specific row, you can use this solution, and then remove the extra rows using the same solution.

    Sep 4, 2013 at 13:32

  • The Overflow Blog
  • Featured on Meta

Related

Hot Network Questions

  • Matching words from a text with a big list of keywords in Python

  • Birth time of files are missing if file is created in a logical volume with size less than 512 MB

  • Do I know all the abilities of a Dominated creature?

  • What’s up with banks closing down their high yield savings accounts and incentives lately?

  • How can any light get past a polarizer?

  • Air Conditioner causing rapid high CO2 levels — anyone know why, or how to fix?

  • PC to phone file transfer speed

  • Can this disconnect be reused?

  • When does a spatula or spoon become sterile during cooking?

  • Is there a way to calculate a hash with two people so that no one knows the pre-image but if they get together they do?

  • Not able to create a mesh from data in obj format using python api

  • Antonym for “elitist” with a negative connotation?

  • How would a future humanity «terraform» the moon?

  • What are the *musts* of PGN?

  • What are these components for?

  • What is the difference between elementary and non-elementary proofs of the Prime Number Theorem?

  • Getting an «Incorrect syntax near ‘(‘ » error message when using the standard create table using a select in SQL Server

  • What do ‘spile’ and ‘bung’ mean in this sentence written by Thoreau?

  • Electricity — Why is current, same throughout a circuit?

  • What should I do after my PhD supervisor calls me a retard to my face?

  • «Why» do animals excrete excess nitrogen instead of recycling it?

  • MOSFET Overheating, Arduino heating pad project

  • What happens if input voltage to switching regulator is outside of its specifications?

  • What additional inputs are required to convert dBFS to dB SPL?

more hot questions

Question feed

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

See all How-To Articles

This tutorial demonstrates how to add values to cells and columns in Excel and Google Sheets.

add a value to multiple cells

Add Values to Multiple Cells

  1. To add a value to a range of cells, click on the cell where you want to display the result, and enter = (equal) and the cell reference of the first number then + (plus) and the number you want to add.

For this example, start with cell A2 (200). Cell B2 will show the Price in A2 increased by 10. So, in cell B2, enter:

=A2+10

add a value to multiple cells

As a result, the value in cell B2 is now 210 (value from A2 plus 10).

  1. Now copy this formula down the column to the rows below. Click on the cell where you entered the formula (F2) and place your cursor on the bottom right corner of the cell.
  2. When it changes to a plus sign, drag it down to the rest of the rows where you want to apply the formula (here, B2:B6).

add a value to multiple cells 2

As a result of relative cell referencing, the constant (here, 10) remains the same, but the cell address changes according to the row you are in (so B3=A3+10, and so on).

add a value to multiple cells 3

Add Multiple Cells With Paste Special

You can also add a number to multiple cells and return the result as a number in the same cell.

  1. First, select the cell with the value you want to add (here, cell C2), right-click, and from the drop-down menu, choose Copy (or use the shortcut CTRL + C).

add multiple cells with paste special

  1. After that, select the cells where you want to subtract the value and right-click on the data range (here, A2:A6). In the drop-down menu, click on Paste Special.

add multiple cells with paste special 2

  1. The Paste Special window will appear. Under the Operation section choose Add, and then click OK.

add multiple cells with paste special 3

You’ll see the result as a number within the same cells. (In this example, 10 was added to each value from the data range A2:A6.) This method is better if you don’t want to display the results in a new column and don’t need to retain a record of the original values.

add multiple cells with paste special 4

Add Column With Cell References

To add an entire column to another using cell references, select the cell where you want to display the result, and enter = (equal) and the cell reference for the first number then + (plus) and the reference for the cell you want to add.

For this example, calculate the summary of Price 1 (A2) and Price 2 (B2). So, in cell C2, enter:

=A2+B2

add a column with cell reference

To apply the formula to an entire column, just copy the formula down to the rest of the rows in the table (here, C2:C6).

add a column with cell reference 2

Now, you have a new column with the summary.

add a column with cell reference 3

Using the methods above, you can also subtract, multiply, or divide cells and columns in Excel.

Add Cells and Columns in Google Sheets

In Google Sheets, you can add multiple cells using formulas in exactly the same ways as in Excel; except, you can’t use Paste Special.

add values gs

  1. 04-25-2005, 07:06 AM


    #1

    Change all values in an excel column at once?

    I have an Access database I’m attempting to modify a bit in Excel. It has
    over 16500 rows. I want to add 30 to all 16500+ values in a certain column.
    Is there any way to do this in one step, or am I doomed to manually change
    them one at a time?


  2. 04-25-2005, 07:06 AM


    #2

    Re: Change all values in an excel column at once?

    Enter 30 in a cell. Edit>Copy
    Select your cells to be updated, Edit>Paste Special, check Add.

    Kind Regards,

    Niek Otten

    Microsoft MVP — Excel

    «Sn0wman» <Sn0wman@discussions.microsoft.com> wrote in message
    news:C902BB6C-0AB0-495A-ABBF-B222DE017259@microsoft.com…


    >I have an Access database I’m attempting to modify a bit in Excel. It has
    > over 16500 rows. I want to add 30 to all 16500+ values in a certain
    > column.
    > Is there any way to do this in one step, or am I doomed to manually change
    > them one at a time?


  3. 04-25-2005, 07:06 AM


    #3

    Re: Change all values in an excel column at once?

    Sn0wman, put 30 in a cell, copy it, select the cells you want to add 30 to,
    right click and paste special, under operation check add, OK.


    Paul B
    Always backup your data before trying something new
    Please post any response to the newsgroups so others can benefit from it
    Feedback on answers is always appreciated!
    Using Excel 2002 & 2003

    «Sn0wman» <Sn0wman@discussions.microsoft.com> wrote in message
    news:C902BB6C-0AB0-495A-ABBF-B222DE017259@microsoft.com…


    > I have an Access database I’m attempting to modify a bit in Excel. It has
    > over 16500 rows. I want to add 30 to all 16500+ values in a certain

    column.
    > Is there any way to do this in one step, or am I doomed to manually change
    > them one at a time?


  4. 04-25-2005, 08:06 AM


    #4

    Re: Change all values in an excel column at once?

    Thank you both very much. Exactly the info I was looking for, and I was
    having trouble weeding through over 420,000 hits on Google to find it.


  5. 04-25-2005, 09:06 AM


    #5

    Re: Change all values in an excel column at once?

    I’d expect if you’d wanted to multiply instead of add and limited yourself
    to Excel newsgroups, there would have been less hits and the answers
    would have been faster to go through and more of them would be about the same.

    Also the word «change» in your question could perhaps of been better
    as «add a constant to» . Which having tried searching Google you
    should appreciate having a subject as descriptive as possible with
    what you know.

    Any way, glad you got your answer, and for those that answer questions
    it is a lot nicer to know that you tried to look up a solution first before
    posting. To make it more friendly for those answering, I like to see
    a person’s real name.

    HTH,
    David McRitchie, Microsoft MVP — Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    «Sn0wman» <Sn0wman@discussions.microsoft.com> wrote …


    > Thank you both very much. Exactly the info I was looking for, and I was
    > having trouble weeding through over 420,000 hits on Google to find it.


Formulas are the life and blood of Excel spreadsheets. And in most cases, you don’t need the formula in just one cell or a couple of cells.

In most cases, you would need to apply the formula to an entire column (or a large range of cells in a column).

And Excel gives you multiple different ways to do this with a few clicks (or a keyboard shortcut).

Let’s have a look at these methods.

By Double-Clicking on the AutoFill Handle

One of the easiest ways to apply a formula to an entire column is by using this simple mouse double-click trick.

Suppose you have the dataset as shown below, where want to calculate the commission for each sales rep in Column C (where the commission would be 15% of the sale value in column B).

Dataset to apply formula to an entire column

The formula for this would be:

=B2*15%

Below is the way to apply this formula to the entire column C:

  1. In cell A2, enter the formula: =B2*15%Formula to calculate the commission
  2. With the cell selected, you will see a small green square at the bottom-right part of the selection. Fill handle in cell selection
  3. Place the cursor over the small green square. You will notice that the cursor changes to a plus sign (this is called the autofill handle)Cursor changes to plus icon
  4. Double click the left mouse keyDouble click on apply formula to the entire column

The above steps would automatically fill the entire column till the cell where you have the data in the adjacent column. In our example, the formula would be applied till cell C15

For this to work, there shouldn’t be data in the adjacent column and there should not be any blank cells in it. If, for example, there is a blank cell in column B (say cell B6), then this auto-fill double click would only apply the formula till cell C5

Fill handle stop when it encounters a blank cell

When you use the autofill handle to apply the formula to the entire column, it’s equivalent to copy-pasting the formula manually. This means that the cell reference in the formula would change accordingly.

For example, if it’s an absolute reference, it would remain as is while the formula is applied to the column, add if it’s a relative reference, then it would change as the formula is applied to the cells below.

By Dragging the AutoFill Handle

One issue with the above double click method is that it would stop as soon as it encountered a blank cell in the adjacent columns.

If you have a small data set, you can also manually drag the fill handle to apply the formula in the column.

Below are the steps to do this:

  1. In cell A2, enter the formula: =B2*15%
  2. With the cell selected, you will see a small green square at the bottom-right part of the selection
  3. Place the cursor over the small green square. You will notice that the cursor changes to a plus signCursor changes to plus icon
  4. Hold the left mouse key and drag it to the cell where you want the formula to be applied
  5. Leave the mouse key when done

Using the Fill Down Option (it’s in the ribbon)

Another way to apply a formula to the entire column is by using the fill down option in the ribbon.

For this method to work, you first need to select the cells in the column where you want to have the formula.

Below are the steps to use the fill down method:

  1. In cell A2, enter the formula: =B2*15%
  2. Select all the cells in which you want to apply the formula (including cell C2)Select the entire column or the range
  3. Click the Home tabClick the Home tab
  4. In the editing group, click on the Fill iconClick on the Fill icon
  5. Click on ‘Fill down’Click on Fill down option

The above steps would take the formula from cell C2 and fill it in all the selected cells

Adding the Fill Down in the Quick Access Toolbar

If you need to use the fill down option often, you can add that to the Quick Access Toolbar, so that you can use it with a single click (and it’s always visible on the screen).

T0 add it to the Quick Access Toolbar (QAT), go to the ‘Fill Down’ option, right-click on it, and then click on ‘Add to the Quick Access Toolbar’

add to quick access toolbar

Now, you will see the ‘Fill Down’ icon appear in the QAT.

Fill Down added to Quick Access toolbar

Using Keyboard Shortcut

If you prefer using the keyboard shortcuts, you can also use the below shortcut to achieve the fill down functionality:

CONTROL + D (hold the control key and then press the D key)

Below are the steps to use the keyboard shortcut to fill-down the formula:

  1. In cell A2, enter the formula: =B2*15%
  2. Select all the cells in which you want to apply the formula (including cell C2)
  3. Hold the Control key and then press the D key

Using Array Formula

If you’re using Microsoft 365 and have access to dynamic arrays, you can also use the array formula method to apply a formula to the entire column.

Suppose you have a data set as shown below and you want to calculate the Commission in column C.

Below is the formula that you can use:

=B2:B15*15%

Array formula to apply formula to an entire column

This is an Array formula that would return 14 values in the cell (one each for B2:B15). But since we have dynamic arrays, the result would not be restricted to the single-cell and would spill over to fill the entire column.

Note that you cannot use this formula in every scenario. In this case, because our formula uses the input value from an adjacent column and as the same length of the column in which we want the result (i.e., 14 cells), it works fine here.

But if this is not the case, this may not be the best way to copy a formula to the entire column

By Copy-Pasting the Cell

Another quick and well-known method of applying a formula to the entire column (or selected cells in the entire column) is to simply copy the cell that has the formula and paste it over those cells in the column where you need that formula.

Below are the steps to do this:

  1. In cell A2, enter the formula: =B2*15%
  2. Copy the cell (use the keyboard shortcut Control + C in Windows or Command + C in Mac)
  3. Select all the cells where you want to apply the same formula (excluding cell C2)
  4. Paste the copied cell (Control + V in Windows and Command + V in Mac)

One difference between this copy-paste method and all the methods convert below above this is that with this method you can choose to only paste the formula (and not paste any of the formattings).

For example, if cell C2 has a blue cell color in it, all the methods covered so far (except the array formula method) would not only copy and paste the formula to the entire column but also paste the formatting (such as the cell color, font size, bold/italics)

If you want to only apply the formula and not the formatting, use the steps below:

  1. In cell A2, enter the formula: =B2*15%
  2. Copy the cell (use the keyboard shortcut Control + C in Windows or Command + C in Mac)
  3. Select all the cells where you want to apply the same formula
  4. Right-click on the Selection
  5. In the options that appear, click on ‘Paste Special’Click on Paste Special
  6. In the ‘Paste Special’ dialog box, click on the Formulas optionSelect formulas in Paste Special dialog box
  7. Click OK

The above steps would make sure that only the formula is copied to the selected cells (and none of the formattings comes over with it).

So these are some of the quick and easy methods that you can use to apply a formula to the entire column in Excel.

I hope you found this tutorial useful!

Other Excel tutorials you may also like:

  • 5 Ways to Insert New Columns in Excel (including Shortcut & VBA)
  • How to Sum a Column in Excel
  • How to Compare Two Columns in Excel (for matches & differences)
  • Lookup and Return Values in an Entire Row/Column in Excel
  • How to Copy and Paste Columns in Excel?
  • Apply Conditional Formatting Based on Another Column in Excel
  • How to Multiply a Column by a Number in Excel

Понравилась статья? Поделить с друзьями:
  • Set column name in excel
  • Set colours in excel
  • Set color to cell in excel
  • Set color in vba excel
  • Set color for cell excel