ESCRIPTION:
I have a .csv product file and one column has pricing data and the column next to it is empty. I need to fill in the data that matches the pricing column. For example if one of the box is 22.99 I need the empty colum box on same row to be certain number. And if another box is same price then same number gets filled. But if it's different number different number is filled and so forth. 1. Do you see column P (Header is Variant Price) 2. Next to the column on the left is column O (Header is Variant grams) (So you can see that it's filled with 136 right) 3. I have to basically fill the column O (variant grams) that corresponds to number range 4. So let's say if column P has number range from 1-8.99 I need the corresponding column on left (O Variant grams) to be a certain number. So same row, and so forth 5. Column O is prefilled with 136 and the following range will be used to fill in the Column O boxes and delete 136 (if it's 136 then just it will not delete it) range 0 - 7.99 = 136 grams (word gram will be omitted just need it to be a number) 7.99 - 14.95 = 226 14.96 - 26.95 = 317 26.96 - 35.95 = 431 35.96-53.95 = 1360 53.96 - 64.95 = 2276 64.96 - 74.95 = 2948 74.96 - 1000 = 3175 These are temporarily ranges, but as my shop prices and shipping weight changes, I'm hoping the formula or vba can be easily changed by me SO UPDATE... I did a session and got this formula =IF(P444<14.95,226, IF(P444<26.95, 317, IF(P444<35.95, 431, IF(P444<53.95, 1360, IF(P444<64.95, 2276, IF(P444<74.95, 2948, IF(P444<1000, 3175, 0))))))) But this was wrong so need the correct one.
So this is the formula I got for the second time
=INDEX(Sheet1!$D$2:$D$9,COUNTIF(Sheet1!$C$2:$C$9,"<="&$P2)+1) and is accurate but not sure how to apply to the whole column.. same number shows up
Solved by X. W. in 30 mins