I have a first column say named as 1 to 100. I want to enter a random number from 1 to 100 in the second column and the corresponding on the first column shall be deleted immediately. How do I write a formula to do this activity?
I have a first column say named as 1 to 100. I want to enter a random number from 1 to 100 in the second column and the corresponding on the first column shall be deleted immediately. How do I write a formula to do this activity?
Welcome to the forum.
This can't be done with a formula - a formula is not capable of deleting data. Shall I move this to the VBA section for you?
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
Instead of deleting is it possible to change to zero. I am not familiar with VBA
No, I am afraid not.
Could maybe do with some additional context, otherwise why not use the inbuilt Find and Replace and enter a random number there?
Thank you. Still need a programme it seems.
You cannot change anything in the source column with a formula. You could extract the remaining values elsewhere. But, given you want to generate a random number, Im not sure what the recalculation would do/show.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Maybe:
A1:Formula:
Please Login or Register to view this content.
B1:Formula:
Please Login or Register to view this content.
C1:Formula:
Please Login or Register to view this content.
Thank you very much. It workswell. If the Column B has more than one number how to change this?
Try this in C1.
![]()
Please Login or Register to view this content.
This:
=SEQUENCE(100)
=RANDBETWEEN(1,100)
=FILTER(A1#,A1#<>B1)
Formula:
Please Login or Register to view this content.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
Excellent and Thankyou very much. That resolved my issue.
You're welcome. Thanks for the rep.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
Thank you for the suggestion. I have added reputations and marked the Thread as resolved. Great service and thanks for your guidance.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks