calculate vba

rakesh seebaruth

Active Member
Joined
Oct 6, 2011
Messages
303
Dear all

I have the following data as follows

Table 1
[TABLE="width: 304"]
<tbody>[TR]
[TD="colspan: 2"]
Valuation Amount fees[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]0 to 2,500,000
[/TD]
[TD]2,300
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]2,500,001 to 5,000,000
[/TD]
[TD]3,450
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]5,000,001 to 7,500,000
[/TD]
[TD]4,945
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]7,500,001 to 10,000,000
[/TD]
[TD]6,325
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]10,000,001 to 15,000,000
[/TD]
[TD]8,625
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]15,000,001 to 25,000,000
[/TD]
[TD]13,800
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]Above 25,000,000
[/TD]
[TD]Negotiable
[/TD]
[/TR]
[TR]
[TD="colspan: 2"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]table 2[/TD]
[TD="colspan: 2"]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Inspected Value
[/TD]
[TD]Fees
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]900,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]5,800,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]2,200,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]2,300,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]450,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]2,600,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]9,000,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]2,300,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]1,300,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]5,500,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="colspan: 2"]30,000,000
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

If inspected value is 900,000 then fees should be 2300( 900,000 falls in the range of 0 to 2,500,000) .If inspected value is 5,800,000 then fees should be 4,945(5,800,000 falls in the range of 5,000,001 to 7,500,000). Is it possible for VBA to calculate the fees for the inspected value as per Table 1.

Thanks.regards

rakesh
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Similar threads

Forum statistics

Threads
1,226,729
Messages
6,192,696
Members
453,747
Latest member
tylerhyatt04

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