Formatting data from TRIM function

jimonfly

New Member
Joined
May 7, 2011
Messages
21
I am using the TRIM function to pull information from one sheet into a pre-designed table. I want the new table to contain the data in the same format as the original regarding 1,000 separator comma and % (pulls in .20 instead of 20% from original). Also, I want blank cells to be blank, and not contain "0". The original data is formatted correctly and contains a mix of text, dates, numbers and percentages.

Is there another function to use?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
How are you using TRIM exactly?
 
Upvote 0
My formula is: =TRIM('Lease Expiration Excel'!D16)

I have data exported from another program into an excel sheet. I copy/paste the data from that sheet into a sheet in my workbook. What I want to happen is the data will be pulled from that sheet into a predefined table on another sheet. My problem is the pasted sheet is formatted for text, number, percentage already. After I use the TRIM command, the formatting is defaulted back to General, and I loose my 1,000 separator comma and my % formatting. If I don't use TRIM, I get "0" where blank cells should be.

After the data is brought in to the predefined table, I can change the cell formatting off the right-click menu, but the changes have no affect on the data (no 1,000 commas, % signs).
 
Upvote 0
TRIM returns a string, so the number formatting doesn't apply.

How about =if(d16="", "", d16)
 
Upvote 0
Thanks, that will work. I can manually format the percentage row afterward because I cannot predict where it will be located.

Jim
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,703
Members
452,938
Latest member
babeneker

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