Do i need a formula or macro to do this?

jaugent27

New Member
Joined
Jan 30, 2009
Messages
16
Office Version
  1. 365
Platform
  1. MacOS
I have a spreadsheet that has about 1,500 products. Each product has a list cost, or Price Level 1, along with 9 more price levels, each with a discounted price. I need to create a column that determines the discount % from Price Level 1. Since each product has 11 rows (not sure why the doc has a last row with no price level listed but that's how it is), I can't simple copy the formula down and expect it to find the Level 1 price each time. I'm sure this can be done with an IF statement, IF column A says "Price Level 10" do this formula, but it would be tricky to then have it calculate Price Level 1 price for each one unless there's a way to say 'go two rows up' depending on which price level you're at. It seems the doc is consistent in how the price levels are listed 1, 10, 3-9, 2. I would also assume it's easiest to do this with a macro, but I've never done that so wouldn't even know where to start. Hopefully one of the Mr Excel ace's can help out. I really appreciate it!

And then: once I get the above figured out, I'll need to analyze the discount variances within each price level. So for all price level 2 %'s, what is the high/low/average, or maybe even chart them. How would I go about that. Obviously this is very much secondary to the above.

See mini sheet below. Thanks!

Price Level worksheet.xlsx
ABCDE
1Price LevelItem NumberProduct DescriptionPrice per UnitDiscount from Level 1
2Price Level 1212092Standard widget, red gasket, alum. head, 3 3/4" exposed73.35
3Price Level 10212092Standard widget, red gasket, alum. head, 3 3/4" exposed55.2724.65%
4Price Level 3212092Standard widget, red gasket, alum. head, 3 3/4" exposed64.8011.66%
5Price Level 4212092Standard widget, red gasket, alum. head, 3 3/4" exposed61.1016.70%
6Price Level 5212092Standard widget, red gasket, alum. head, 3 3/4" exposed59.1319.39%
7Price Level 6212092Standard widget, red gasket, alum. head, 3 3/4" exposed57.4821.64%
8Price Level 7212092Standard widget, red gasket, alum. head, 3 3/4" exposed57.1822.04%
9Price Level 8212092Standard widget, red gasket, alum. head, 3 3/4" exposed56.9922.30%
10Price Level 9212092Standard widget, red gasket, alum. head, 3 3/4" exposed56.7722.60%
11Price Level 2212092Standard widget, red gasket, alum. head, 3 3/4" exposed68.866.12%
12212092Standard widget, red gasket, alum. head, 3 3/4" exposed73.35
13Price Level 1212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed57.75
14Price Level 10212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed46.20
15Price Level 3212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed53.49
16Price Level 4212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed52.15
17Price Level 5212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed50.85
18Price Level 6212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed49.58
19Price Level 7212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed48.34
20Price Level 8212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed47.62
21Price Level 9212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed46.90
22Price Level 2212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed54.86
23212312Light Weight widget, GREEN gasket, alum head, 3 3/4" exposed57.75
24Price Level 1212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed62.53
25Price Level 10212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed50.80
26Price Level 3212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed58.51
27Price Level 4212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed57.34
28Price Level 5212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed56.20
29Price Level 6212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed55.07
30Price Level 7212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed53.97
31Price Level 8212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed52.89
32Price Level 9212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed51.83
33Price Level 2212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed59.40
34212336Light Weight Long widget, BLACK gasket, plastic head, 4" exposed62.53
Sheet1
Cell Formulas
RangeFormula
E3:E11E3=(D$2-D3)/D$2
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
May be:
E2:
Code:
=IF(OR(A2="Price Level 1",A2=""),"",(LOOKUP(2,1/($A$2:A2="Price Level 1")/($B$2:B2=B2),$D$2:D2)-D2)/LOOKUP(2,1/($A$2:A2="Price Level 1")/($B$2:B2=B2),$D$2:D2))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

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