Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I increase value of selected field by N%

What I have tried:

How do I increase value of selected field by N%
[^][^]
Posted
Updated 28-Jul-17 15:42pm

cell ref * N% - example for 30%:
=A1*30/100
 
Share this answer
 
Comments
vishal2592 28-Jul-17 9:02am    
For this I need special cell and then I need copy that cell and paste it original cell.

I have 50 cell to do this operation so can i do it with just selection of cell?
Graeme_Grant 28-Jul-17 9:09am    
That is why you use a formula like above.

If all 50 cells are in one column, for example, Column A, and start at Row 1, then put the formula above in cell B1, then copy cell B1 and paste in cells B2 to B50 and Excel will automatically adjust the formula with the correct cell references.
Graeme_Grant 28-Jul-17 9:12am    
Actually, the formula above will DECREASE the value in the cell...

A1 * 30 / 100 = A1 * 0.3

You need to multiply by ( 1 + n%)

You can do this either by formula, with the result ending up in a different cell, or you apply this to all selected cells and the result will be in the same cells as the original value... using COPY / PASTE SPECIAL / MULTIPLY

To do this, enter the factor that you want to apply (say 1.3) in a cell. Select that cell and copy it.

Select the range of cells you want to change, click the Paste drop down arrow, select "Paste Special", then select the "Multiply" radio button, and [OK].



Note: If your cells that you are changing have a formula, then the formula is adjusted to include the "*1.3" or whatever you're multiplying by.


Doing this with a macro / vba would be something like:

Option Explicit

Sub MultiplyByFactor()

Dim rngFactor As Range
Dim rng As Range

    Set rngFactor = Application.InputBox("Pick the cell with the factor:", "Select one cell", Type:=8)
    Do While rngFactor.Cells.Count > 1
        If MsgBox("Please select ONE cell only", vbOKCancel, "Uno") = vbCancel Then
            Exit Sub
        End If
        Set rngFactor = Application.InputBox("Pick the cell with the factor:", "Select one cell", Type:=8)
    Loop

    Set rng = Application.InputBox("Pick range to apply this factor to:", "Select one or more cells", Type:=8)
    
    rngFactor.Copy
    rng.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, SkipBlanks:=False, Transpose:=False
End Sub
 
Share this answer
 
v2
Quote:
How do I increase value of selected field by N%

1 prepare a cell with the value you need. Adding N% is multiplying.
-Source cell is =1+N/100
2 Copy that cell
3 Use paste-special with multiplication on target cells.

Have a look here:
Use Paste Special to perform calculations while pasting in Excel - TechRepublic[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900