change last digit in cell if it is a zero

Gastank

New Member
Joined
Feb 17, 2002
Messages
34
Hi,

looking for help please,

In Excel 2010 I am generating a random 5 digit number in cell A1 and I am using the last digit to select the corresponding letter from a word in another cell.

e.g. A1 = 45678 - last digit = 8 corresponding letter from the word "Subscribed" = b

however if A1 = 45670 - last digit = 0 then I receive an error message in my letter selection cell.
Is there a way to automatically change last digit in Cell A1 if it is a zero to any number between 1 and 9.

thanks in advance for any help.
 
Hi,

In Excel 2010 I am generating a random 5 digit number in cell A1 and I am using the last digit to select the corresponding letter from a word in another cell.

e.g. A1 = 45678 - last digit = 8 corresponding letter from the word "Subscribed" = b

however if A1 = 45670 - last digit = 0 then I receive an error message in my letter selection cell.
Is there a way to automatically change last digit in Cell A1 if it is a zero to any number between 1 and 9.

Another thought.
How typical is 'Subscribed' as the word you are selecting from?
As it has 10 letters can you accept any trailing digit 0 - 9 on your random number and use something like below for the selection?

=MID("Subscribed",RIGHT(A1,1)+1,1)
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,885
Messages
6,122,090
Members
449,065
Latest member
Danger_SF

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