What function should i use?

Ofirabo

New Member
Joined
Mar 15, 2011
Messages
6
Hello,

I have column contains "text values" few of them have "-" (hyphen) on their right, what function should i use to exclude and show them in a different column?

for example:

apple
apple -
orange
tomato-

I want to see in a different column the following values:
apple -
tomato-

Thanks
Ofira
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
If you want to pick only the lines with the hyphen on the right you might want to try something like:

=IF(RIGHT(TRIM(A1),1)="-",A1,"")

This formula leaves the ones without the hyphen at the end blank. I decided to use the TRIM there as well just in case there were spaces after the hyphen in the cell value.

If you want to move the contents of the original cell to another column (=leaving the original cell empty) then you need to use a macro or do it manually. If it's enough that the original value with the hyphen at the end isn't visible you could try hiding it with conditional formatting.
 
Upvote 0

Forum statistics

Threads
1,214,528
Messages
6,120,065
Members
448,941
Latest member
AlphaRino

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