最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Excel Formula Bar Line Break Disappears When Navigating Away - Stack Overflow

programmeradmin2浏览0评论

I frequently include line breaks in Excel formulas to improve readability. For example:

=IF(B6="Grand Total" ,GETPIVOTDATA("Source_File_Name",$B$5)=GETPIVOTDATA("Source_File_Name",$D$5) ,GETPIVOTDATA("Source_File_Name",$B$5,"Source_File_Name",B6)=GETPIVOTDATA("Source_File_Name",$D$5,"Source_File_Name",B6))

Recently, Excel has started removing these line breaks after I move to another cell. This happens immediately: I complete the formula, press 'enter', go back to the previous cell, and the line breaks have been removed.

I have tried both the left alt key and right alt key to create the line breaks; I have confirmed that the cell is formatted for 'wrap text'; I am experiencing the same issue either way.

This issue is only occurring for formulas. Text entries are behaving as intended.

Version is Office 365

Any ideas why this is happening? Some formulas can be real behemoths without the line breaks...

I frequently include line breaks in Excel formulas to improve readability. For example:

=IF(B6="Grand Total" ,GETPIVOTDATA("Source_File_Name",$B$5)=GETPIVOTDATA("Source_File_Name",$D$5) ,GETPIVOTDATA("Source_File_Name",$B$5,"Source_File_Name",B6)=GETPIVOTDATA("Source_File_Name",$D$5,"Source_File_Name",B6))

Recently, Excel has started removing these line breaks after I move to another cell. This happens immediately: I complete the formula, press 'enter', go back to the previous cell, and the line breaks have been removed.

I have tried both the left alt key and right alt key to create the line breaks; I have confirmed that the cell is formatted for 'wrap text'; I am experiencing the same issue either way.

This issue is only occurring for formulas. Text entries are behaving as intended.

Version is Office 365

Any ideas why this is happening? Some formulas can be real behemoths without the line breaks...

Share Improve this question edited Mar 31 at 17:04 Mark S. 2,7991 gold badge9 silver badges28 bronze badges asked Mar 31 at 15:07 StorphidStorphid 435 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 6

The issue you're encountering is due to the way the formula is being written. End your lines with commas instead of starting the next line with it.

By writing it this way, excel will put the formula back into a single line.

=IF(B6="Grand Total" ,GETPIVOTDATA("Source_File_Name",$B$5)=GETPIVOTDATA("Source_File_Name",$D$5) ,GETPIVOTDATA("Source_File_Name",$B$5,"Source_File_Name",B6)=GETPIVOTDATA("Source_File_Name",$D$5,"Source_File_Name",B6))

By writing it this way, excel will maintain the line breaks.

=IF(B6="Grand Total", GETPIVOTDATA("Source_File_Name",$B$5)=GETPIVOTDATA("Source_File_Name",$D$5), GETPIVOTDATA("Source_File_Name",$B$5,"Source_File_Name",B6)=GETPIVOTDATA("Source_File_Name",$D$5,"Source_File_Name",B6))

发布评论

评论列表(0)

  1. 暂无评论