0
votes

I have an excel sheet with few columns. One of the columns is a drop down based on a handful of values that I added. However, For each drop down value there is a matching account number which I would like auto populated once the drop down value is selected. Column D has the drop down and the drop down values and accounts are in BR5: BS38 and Would like the account to be populated in column E automatically everytime a drop down values is chosen.

Code I am using, however, it doesnt populate automatically, I have to copy the formula down and when I copy it down, if nothing is chosen in the drop down it will se #N/A.

=VLOOKUP(D5:D38,$BR$3:$BS$38,2,0)
1

1 Answers

2
votes

Without VBA the formula will have to be copied down.

An easy work around would be to nest your vlookup in an iferror function and have it already populated in a set range of rows. So if you know the user will never type more than 1000 rows have the formula already there.

Your new formula would look like this. The only thing this does is remove the #N/A. Not sure why you specified a range in your vloopup lookup value, so this formula only picks the first cell in that range.

=IFERROR(VLOOKUP(D5,$BR$3:$BS$38,2,0), "")

If you would like some error checking, not sure if your drop down allows foreign values, you can use a formula like this

=IF(D5="","",IFERROR(VLOOKUP(D5,$BR$3:$BS$38,2,0),"Not Found"))