Populate data based on ranges of other data

Chezzo

New Member
Joined
Aug 23, 2010
Messages
3
Hi there,

I'm new to VBA but not to programming in general. I need to populate a cell based on another cell.

So if a cell has $0 - $100, the other cell needs to populate with $.15 and another cell populates with $15. If the cell is $100 - $250, the other cell populates with $.10 and another populates with $10.

Can someone point me to an example that does something like this?

Thanks!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
So, what is the complete scope of your Ranges?? Are there more that just these two??
lenze
 

Chezzo

New Member
Joined
Aug 23, 2010
Messages
3
Man, thanks! You got me thinkin' that it could be done with a formula, so I came up with this:

=IF(A1<100,0.15,IF(A1<250,0.1,IF(A1<500,0.09,IF(A1<1000,0.08,IF(A1<2000,0.07,IF(A1<4000,0.06,"BONK!"))))))

That looks at A1, and if it's less than 100, fill the cell with .15, if it's not less than 100, it looks at A1 and sees if it's less than 250... And so on.

I'll just do that in the next cell with the other data.

Thanks!
 

Watch MrExcel Video

Forum statistics

Threads
1,133,810
Messages
5,661,039
Members
418,612
Latest member
iihtsurat5

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
Top