Forum Discussion
Substituting text (based on a key) in a cell already containing the 'concatenate' formula
Hi there,
I am a teacher and am trying to personalise a paragraph of text that has already been pre-populated, and concatenated from statements pulled from another sheet. Do I need to tell excel to copy this text to the adjacent cell first, and then substitute the specified key words there, or can it be changed in the original cell with the new formula being added to the concatenated one?
Below is a screenshot of what I have so far and the formula already in cell D3 is: =CONCATENATE('Maths data'!F8," ",'Maths data'!I8," ",'Maths data'!R8," ",'Maths data'!AA8," ",'Maths data'!AJ8," ",'Maths data'!AS8," ",'Maths data'!BB8," ",'Maths data'!BK8," ",'Maths data'!BT8," ",'Maths data'!CC8," ",'Maths data'!CL8)
So what I would like to do is:
- Where C3 shows 'f', I would like the paragraph to show female pronouns (or male ones for 'm')
- Substitute the following symbols for actual words: #N= the name that is shown in cell B1 #E=She.He.They #e=she.he.they #H=His.Her.Their #h=his.her.their #m=him.her.them #b=boy.girl.child #s=herself.himself.themself
Thanks ever so much for anyone that can help - I've spent hours scouring youtube and have been taking an online course in excel to help me with this project- but this is way beyond my capabilities - and sanity!
Susie
=SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
CONCATENATE('Maths data'!F8," ",'Maths data'!I8," ",'Maths data'!R8," ",'Maths data'!AA8," ",'Maths data'!AJ8," ",'Maths data'!AS8," ",'Maths data'!BB8," ",'Maths data'!BK8," ",'Maths data'!BT8," ",'Maths data'!CC8," ",'Maths data'!CL8),
"#N",B3),
"#E",IF(C3="f","She","He")),
"#h",IF(C3="f","her","his")),
"#H",IF(C3="f","Her","His"))
You can apply the SUBSTITUTE function.
4 Replies
- OliverScheurichGold Contributor
=SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
CONCATENATE('Maths data'!F8," ",'Maths data'!I8," ",'Maths data'!R8," ",'Maths data'!AA8," ",'Maths data'!AJ8," ",'Maths data'!AS8," ",'Maths data'!BB8," ",'Maths data'!BK8," ",'Maths data'!BT8," ",'Maths data'!CC8," ",'Maths data'!CL8),
"#N",B3),
"#E",IF(C3="f","She","He")),
"#h",IF(C3="f","her","his")),
"#H",IF(C3="f","Her","His"))
You can apply the SUBSTITUTE function.
- Susie_PCopper ContributorBrilliant - this works, thank you so much!
Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?
- Susie_PCopper ContributorThanks Hans - I have tried the suggestion from OliverScheurich and it worked.
Thanks for taking the time to reply to me though 🙂