close

I have a formula and then a label concatenated onto the end which works fine
but now I realize I have to format the numeric portion since it is working
with too many decimals. I know how to do this in access but not excel.

The formula is:
=IF(F10-H10gt;0,(F10-H10) amp;quot; LOSSquot;,(H10-F10) amp; quot; PROFITquot;)

In msaccess, I would just add:
=IF(F10-H10gt;0,format((F10-H10),quot;fixedquot;) amp;quot; LOSSquot;,format((F10-H10),quot;Fixedquot;) amp;
quot; PROFITquot;)

How do I do this in excel??

Convert the subtraction to a string and then format the string using a
format mask.

Your True/False statements currenlty look like this:

(F10-H10) amp;quot; LOSSquot;,(H10-F10) amp; quot; PROFITquot;

Change them to:

TEXT((F10-H10),quot;$#,##0.00quot;) amp;quot; LOSSquot;,TEXT((H10-F10),quot;$#,##0.00quot;) amp; quot; PROFITquot;)
--
Kevin Backmannquot;loulouquot; wrote:

gt; I have a formula and then a label concatenated onto the end which works fine
gt; but now I realize I have to format the numeric portion since it is working
gt; with too many decimals. I know how to do this in access but not excel.
gt;
gt; The formula is:
gt; =IF(F10-H10gt;0,(F10-H10) amp;quot; LOSSquot;,(H10-F10) amp; quot; PROFITquot;)
gt;
gt; In msaccess, I would just add:
gt; =IF(F10-H10gt;0,format((F10-H10),quot;fixedquot;) amp;quot; LOSSquot;,format((F10-H10),quot;Fixedquot;) amp;
gt; quot; PROFITquot;)
gt;
gt; How do I do this in excel??
gt;

Try this one:
=TEXT(F10-H10,quot;$0.00quot;)amp;IF(F10-H10gt;0,quot; Lossquot;,quot; Profitquot;)

How likely is it that F10-H10 will equal zero? In this scenario, a
result of zero will be labeled as quot;Profitquot;, just fyi.Loulou, try
=TEXT(ABS(F10-H10),quot;0.00quot;) amp; IF(F10-H10gt;0,quot; LOSSquot;,quot; PROFITquot;)

(this gives 2 decimal places)

Andrewloulou wrote:
gt; I have a formula and then a label concatenated onto the end which works fine
gt; but now I realize I have to format the numeric portion since it is working
gt; with too many decimals. I know how to do this in access but not excel.
gt;
gt; The formula is:
gt; =IF(F10-H10gt;0,(F10-H10) amp;quot; LOSSquot;,(H10-F10) amp; quot; PROFITquot;)
gt;
gt; In msaccess, I would just add:
gt; =IF(F10-H10gt;0,format((F10-H10),quot;fixedquot;) amp;quot; LOSSquot;,format((F10-H10),quot;Fixedquot;) amp;
gt; quot; PROFITquot;)
gt;
gt; How do I do this in excel??

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()