Multiplying with cells based on a criteria

svh105

New Member
Joined
Apr 24, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi everyone,

I am new to using VBA and not totally comfortable with Excel yet.

I have a project where I need to multiply a range of cells with a value that a user inputs in a table.

So if they input the year "2014" in a cell, then the value they input from that year need to be multiplied with another number from 2014, 2015, 2016, 2017, 2018, and 2019. The year they input is different, but all numbers need to be multiplied up until 2019 always.

I have attached a picture of how the excel sheet would sort of look like. The idea is that when another table to the right is added below the others, that the "price in 2019" would be calculated automatically. The calculation is included at the top of the screenshot for clarity.

I have tried some VBA before but when googling how to approach this task I get nowhere. Hope that someone can point me in the right direction :-) And that my explanation makes sense.

Thank you so much.
 

Attachments

  • Skærmbillede 2022-05-02 kl. 20.30.57.png
    Skærmbillede 2022-05-02 kl. 20.30.57.png
    57.8 KB · Views: 29

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I have continued to look into this but finding it quite hard. I think I need to use some nested loops for make it work. If anyone is still wanting to help it would really appreciate it :)
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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