Trailing Commas

dedelkoo

New Member
Joined
Mar 19, 2010
Messages
28
Good Morning All;

I'm hoping someone can help me with a formula that's adding a bunch of trailing commas to CSV files. Currently the formula reads:

=IF(ISBLANK(Parameters!A23),"",Parameters!A23)

The purpose is to draw in the value of cell A23 if in fact a value exists, if not the formula's result should be a blank cell. However when converting the file into CSV the "" registers as data, as such there are comma's at the end of each line with blank data.

Is there away to alter the formula above so that if Parameters!A23 is blank the result of the formula is a completely blank cell that would not be caught in a CSV file?

All thoughts are appreciated,

Derek
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
As you are dealing with column A - the first column then you must have a comma to indicate the presence of the cell - otherwise data in column B will land in A when you load the csv into excel.

Oooppsss I misread something ..... ignore my comment
 
Upvote 0
Thanks for the quick reply; I should have explained a bit better: the result of this fomula will be turned into a CSV file for upload into another program, not turned from a CSV into an excel sheet. The problem we're experiencing now is that the CSV file looks something like:

Betty, controller,
Tom, account manager,
Steve, admin,
, , ,
, , ,
, , ,
, , ,

Where the last three lines are the result of formuale that return a "" value in my formula above. I'm hoping there's a way that the formulae return a value that the CSV would completely ignore so that the CSV file would not have the last 4 lines above.

Betty, controller,
Tom, account manager,
Steve, admin,

For example.

Derek
 
Upvote 0
I don't think that is possible... I'm pretty sure you will get a line regardless because Excel is probably processing each cell in turn and recognising that there are later cells it has to put out the delimiter as a place marker.

Your best bet might be to have a macro for the save process and in that macro delete any blank lines
 
Upvote 0
That's what I was affraid of, thanks for the input. I'll start crafting the clean-up macro.

Thanks again,

Derek
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,887
Members
452,948
Latest member
Dupuhini

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