Reference other cell but only show last word

Excel Pooh

New Member
Joined
Jul 20, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Good afternoon friends, I am calling on your wisdom yet again. I have an IF formula that pulls a text string from a referenced cell, but I would like it to only show the last word. Right now it may pull "Los Angeles Millwork" or "Texas Truss" or the like, I would like it to only display "Millwork" or "Truss". I have been able to do this inside more simple formulas in the past, but am not sure how to apply it to my current formula. ANy ideas how I could adjust the below to only show the last word? Thanks in advance!

=IFERROR(IF(INDIRECT("'"&$Q$1&"'!E3")="Home",INDIRECT("'"&$Q$1&"'!C3"),INDIRECT("'"&$Q$1&"'!A3")),"-")
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Since you did not provide any data, I can't tell what the code should look like.

If you only need a formula for the last word, use this and change all "A1" instances to the cell you need the word from:
Excel Formula:
=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)))
 
Upvote 0
Try adjusting your formula to this
Excel Formula:
=IFERROR(TEXTAFTER(IF(INDIRECT("'"&$Q$1&"'!E3")="Home",INDIRECT("'"&$Q$1&"'!C3"),INDIRECT("'"&$Q$1&"'!A3"))," ",-1),"-")

Or, if the formula is rearranged it can be shortened somewhat like this
Excel Formula:
=IFERROR(TEXTAFTER(INDIRECT("'"&$Q$1&"'!"&IF(INDIRECT("'"&$Q$1&"'!E3")="Home","C3","A3"))," ",-1),"-")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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