ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IF formula with correct formatting in result (https://www.excelbanter.com/excel-programming/365896-if-formula-correct-formatting-result.html)

tmp4

IF formula with correct formatting in result
 
This may be simple for someone
Cell A1 = $3,500
Cell A2 = $2,000
example formula
=IF(A1="","",IF(A1=A2,"ok - matched",IF(A1-A20,A1-A2&" overstated","A2-A1&"
understated")))
This if statement provides the answer -- 1500 overstated
But I want the answer to be -- $1,500 overstated
Is there a way I can build the formatting of the dollar amount into the IF
statement, or is there a way I can enter a custom format that allows for the
varying text depending on the sum result.

thanks for your help

JMB

IF formula with correct formatting in result
 
You could use the text function
TEXT(A1-A2,"$#,##0)&" overstated"


"tmp4" wrote:

This may be simple for someone
Cell A1 = $3,500
Cell A2 = $2,000
example formula
=IF(A1="","",IF(A1=A2,"ok - matched",IF(A1-A20,A1-A2&" overstated","A2-A1&"
understated")))
This if statement provides the answer -- 1500 overstated
But I want the answer to be -- $1,500 overstated
Is there a way I can build the formatting of the dollar amount into the IF
statement, or is there a way I can enter a custom format that allows for the
varying text depending on the sum result.

thanks for your help


JMB

IF formula with correct formatting in result
 
Left out a quote
TEXT(A1-A2,"$#,##0")&" overstated"


"JMB" wrote:

You could use the text function
TEXT(A1-A2,"$#,##0)&" overstated"


"tmp4" wrote:

This may be simple for someone
Cell A1 = $3,500
Cell A2 = $2,000
example formula
=IF(A1="","",IF(A1=A2,"ok - matched",IF(A1-A20,A1-A2&" overstated","A2-A1&"
understated")))
This if statement provides the answer -- 1500 overstated
But I want the answer to be -- $1,500 overstated
Is there a way I can build the formatting of the dollar amount into the IF
statement, or is there a way I can enter a custom format that allows for the
varying text depending on the sum result.

thanks for your help


tmp4

IF formula with correct formatting in result
 
Thanks, I'l go and try that now

"JMB" wrote:

Left out a quote
TEXT(A1-A2,"$#,##0")&" overstated"


"JMB" wrote:

You could use the text function
TEXT(A1-A2,"$#,##0)&" overstated"


"tmp4" wrote:

This may be simple for someone
Cell A1 = $3,500
Cell A2 = $2,000
example formula
=IF(A1="","",IF(A1=A2,"ok - matched",IF(A1-A20,A1-A2&" overstated","A2-A1&"
understated")))
This if statement provides the answer -- 1500 overstated
But I want the answer to be -- $1,500 overstated
Is there a way I can build the formatting of the dollar amount into the IF
statement, or is there a way I can enter a custom format that allows for the
varying text depending on the sum result.

thanks for your help



All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com