ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   text if negative value (https://www.excelbanter.com/excel-worksheet-functions/240510-text-if-negative-value.html)

Coco212

text if negative value
 
How do I write a function to subtract one row/column cell from one other
row/column cell, comparative by location, such as the cell on the same row
but the column before it?
or after it?
then change the cell color?
and font color?
then tell to "use another cell " if the value is a negative number?

Something like,
=if (same row, column to the left)-(same row, column two columns over to the
left)"greater than" (ten or more greater than) then turn cell dark red and
turn font white,
and
=if (same row, column to the left)-(same row, column two columns over to
the left)"greater than" = < "zero" enter text "Use cell in (threes columns
to the left, same row)
Thanks,
Syndy

Mike H

text if negative value
 
Hi,

This is a bit confusing but try this in D1 and drag down as required. You
can then use conditional formatting on D1 to set the cell/font colour you
want depending on the result.

=IF(C1-B1<=0,A1,"")

Mike

"Coco212" wrote:

How do I write a function to subtract one row/column cell from one other
row/column cell, comparative by location, such as the cell on the same row
but the column before it?
or after it?
then change the cell color?
and font color?
then tell to "use another cell " if the value is a negative number?

Something like,
=if (same row, column to the left)-(same row, column two columns over to the
left)"greater than" (ten or more greater than) then turn cell dark red and
turn font white,
and
=if (same row, column to the left)-(same row, column two columns over to
the left)"greater than" = < "zero" enter text "Use cell in (threes columns
to the left, same row)
Thanks,
Syndy


Jacob Skaria

text if negative value
 
Do you mean a generic formula which works on any cell..

1................................................. .................................................. ..........
=if (same row, column to the left)-(same row, column two columns over to the
left)"greater than" (ten or more greater than) then turn cell dark red and
turn font white,


1. Select the column/range of cells
2. From menu FormatConditional Formatting
3. For Condition1Select 'Formula Is' and enter the below formula

(all in one line)
=INDIRECT(ADDRESS(ROW(),COLUMN()-1))-INDIRECT(ADDRESS(ROW(),COLUMN()-2))=10

4. Click Format ButtonPattern and select your color (say Red) and font White
5. Hit OK


2................................................. .................................................. ..........
=if (same row, column to the left)-(same row, column two columns over to
the left)"greater than" = < "zero" enter text "Use cell in (threes columns
to the left, same row)


(all in one line)
=IF(INDIRECT(ADDRESS(ROW(),COLUMN()-1))-INDIRECT(ADDRESS(ROW(),COLUMN()-2))<1,"Use Cell in "&ADDRESS(ROW(),COLUMN()-2),"")


If this post helps click Yes
---------------
Jacob Skaria


"Coco212" wrote:

How do I write a function to subtract one row/column cell from one other
row/column cell, comparative by location, such as the cell on the same row
but the column before it?
or after it?
then change the cell color?
and font color?
then tell to "use another cell " if the value is a negative number?

Something like,
=if (same row, column to the left)-(same row, column two columns over to the
left)"greater than" (ten or more greater than) then turn cell dark red and
turn font white,
and
=if (same row, column to the left)-(same row, column two columns over to
the left)"greater than" = < "zero" enter text "Use cell in (threes columns
to the left, same row)
Thanks,
Syndy



All times are GMT +1. The time now is 08:00 AM.

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