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!
 

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!
 

Forum statistics

Threads
1,082,569
Messages
5,366,360
Members
400,886
Latest member
Fchel

Some videos you may like

This Week's Hot Topics

Top