Forum Discussion
Pull Subset of Data From Cell Based On Value in Another Cell
If I have data in cell A1, I want a number entered into cell A2 to dictate how many and which characters are pulled from A1 and entered into A3 and A4.
For VERY SPECIFIC Examples:
If I have "073852096507" in cell A1, and I type the number 7 into cell A2, I want A3 to return the first 6 digits of A1 and I want A4 to SKIP the first 6 digits of A1 and return the next 5 digits to A4.
If I have "073852096507" in cell A1, and I type the number 8 into cell A2, I want A3 to return the first 7 digits of A1 and I want A4 to SKIP the first 7 digits of A1 and return the next 4 digits to A4.
If I have "073852096507" in cell A1, and I type the number 9 into cell A2, I want A3 to return the first 8 digits of A1 and I want A4 to SKIP the first 8 digits of A1 and return the next 3 digits to A4.
Look forward to any help.
Thank you.
David
7 Replies
- Riny_van_EekelenPlatinum Contributor
- DBradowCopper Contributor
Riny_van_Eekelen After review, it doesn't seem to be pulling the right number of digits into A4. Is there something else I need to do to make it behave exactly like my example? The last digit in A1 should also never appear in A4.
- Riny_van_EekelenPlatinum Contributor
- DBradowCopper ContributorThank you! This was PERFECT!
- mtarlerSilver ContributorIn A3:
=LEFT(A1,A2-1)
In A4:
=MID(A1,A2,LEN(A1)) or =MID(A1,A2,999)- DBradowCopper ContributorThank you!!