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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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,215,088
Messages
6,123,057
Members
449,091
Latest member
ikke

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