Formula using value already within the cell

N_Squared

New Member
Joined
Dec 17, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have some part number tables that are organized a bit oddly with the prices showing up below the part number. I need to update these prices but can't think of a good way to do a formula without having to copy and paste the result back into each row of part numbers. Was hoping there would be a way to apply a formula to the cell itself so I don't have to move stuff around. Or maybe there's a way to just target all of the cells formatted for currency and globally apply the price increase?

Thanks for any insight!

1/81/8
43834​
37257​
320500​
320520​
320540​
320560​
$9.32​
$9.32​
$9.32​
$11.57​
1/81/81/2
2​
320580​
320600​
320620​
320640​
$9.60​
$9.60​
$9.60​
$12.65​
1/81/8
43894​
2-1/2
320660​
320680​
320700​
320720​
$11.09​
$14.75​
$14.75​
$14.75​
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi,
welcome to the board.
I think it would be easier to re-arrange your data so the prices and part numbers are vertical rather than horizontal, this would make copying the formula a little easier.
Having said that and based on your current layout, we can use a vlookup formula for the price cells so that it reads from the master list on the right.
Hope this helps
Paul.

Book1
ABCDEFGHIJKL
11/81/84383437257320500320520320540320560Part #Price
2$9.32$9.32$9.32$11.57320500$9.32
31/81/81/22320580320600320620320640320520$9.32
4$9.60$9.60$9.60$12.65320540$9.32
51/81/8438942-1/2320660320680320700320720320560$11.57
6$11.09$14.75$14.75$14.75320580$9.60
7320600$9.60
8320620$9.60
9320640$12.65
10320660$11.09
11320680$14.75
12320700$14.75
13320720$14.75
Sheet1
Cell Formulas
RangeFormula
E6:H6,E4:H4,E2:H2E2=VLOOKUP(E1,$K$2:$L$13,2,TRUE)
 
Upvote 0
I wish I could reorganize! But that isn't an option at the moment, these tables get copied into a catalog which has been built in inDesign.

I'll see if I can get vlookup working, at the very least looks like it would make it easier to update in the future.
 
Upvote 0
Ok, so I went down a bit of a rabbit hole here but I figured out how to make macros. It's FABULOUS and I can totally do what I'm trying to do using this. But now that I know it's possible I'd like to make it slightly smarter. How would I go about asking this to only apply my calculation for cells formatted as currency within my selection? That way I can just select the whole table, click a button and we're in business.

This is what I have currently:

Sub IncreasePrice()
For Each cell In Selection
If cell <> "" Then
cell.Value = (cell.Value) * 1.42
End If
Next cell
End Sub
 
Upvote 0
Hi,
Give this a try

Forum-vLookup-2.xlsm
ABCDEFGHIJKL
11/81/84383437257320520320520320540320560Multiplier Rate = 1.42
2$13.23$13.23$13.23$16.43
31/81/81/22320580320600320620320640
4$13.63$13.63$13.63$17.96
51/81/8438942-1/2320660320680320700320720
6$15.75$20.95$20.95$20.95
7
Test2


Code:
Sub IncreasePrice2()
Dim c As Range
Dim Mrate As Double
'put the multiplier rate (1.42) in cell K1 or whichever cell you choose
'and change the worksheet tab name to the name you are using.
Mrate = Worksheets("Test2").Range("K1").Value

    For Each c In Selection
        If Len(c.Value) > 0 And Left(c.Text, 1) = "$" Then
            c.Value = c.Value * Mrate
        End If
    Next c
End Sub
 
Upvote 0
Solution
Hi,
Give this a try

Forum-vLookup-2.xlsm
ABCDEFGHIJKL
11/81/84383437257320520320520320540320560Multiplier Rate = 1.42
2$13.23$13.23$13.23$16.43
31/81/81/22320580320600320620320640
4$13.63$13.63$13.63$17.96
51/81/8438942-1/2320660320680320700320720
6$15.75$20.95$20.95$20.95
7
Test2


Code:
Sub IncreasePrice2()
Dim c As Range
Dim Mrate As Double
'put the multiplier rate (1.42) in cell K1 or whichever cell you choose
'and change the worksheet tab name to the name you are using.
Mrate = Worksheets("Test2").Range("K1").Value

    For Each c In Selection
        If Len(c.Value) > 0 And Left(c.Text, 1) = "$" Then
            c.Value = c.Value * Mrate
        End If
    Next c
End Sub
Brilliant! This is great, now I don't have to go back in to change my multiplier between part tables. Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,223,956
Messages
6,175,612
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top