Forcing a cell to format red when another cell's value goes below zero

conton

New Member
Joined
May 25, 2011
Messages
15
I'm using Excel 2007 on Windows XP Professional.

My workbook is very simple: one sheet contains inventories, the other contains individual orders of incoming (negative) and outgoing (positive) inventory. The idea is that the sum of all of the orders for one product will equal the remaining inventory of that product. Here is a very simplified example of what I mean:

Inventory Sheet:
5bIlp.jpg


Orders Sheet:
kAEpl.png


Notice how Jerry's order for 1 hat (D9) has put my hat inventory into the negative (which is fine). I want to have the text in the cell that contains the value that puts that product's inventory into the negative (in this case D9) to turn red automatically.

Hopefully this is clear enough; I will try to clarify further if needed. Thank you in advance for any advice.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Welcome to the board.

In D5, use the CF formula =SUM(D$4:D5)>0 and copy the formatting down.

 
Upvote 0
Hi there, thanks for the quick reply!

I actually tried that, but it yields a somewhat undesired result when more inventory is added. Here's the new Orders sheet with that formatting applied:

xzA3X.jpg


Notice how D9 stays red, even though there has since been more inventory added, and therefore that entry no longer puts the inventory into the negative. I am trying to have only the product orders that currently put the inventory into the negative to appear red (eg. only D12 in the above example).

Hopefully there is a way to do this. Thanks again!
 
Upvote 0
Shg,

Or try this (not need to copy):

1) Select the range C:D.

2) And use CF formula =SUM(C$1:C1)>0

Markmzz
 
Upvote 0
Shg,

Or try this (for Excel 2007 or 2010):

1) Select the range C:D.

2) And use CF formula =(SUM(C$1:C1)>0)*(COUNT(C2:C$1048576)=0)

Markmzz
<!-- / message -->
 
Upvote 0
Hi there,

Thanks for the reply, but that didn't work for me. Still looking for a solution.
Conton,

What was the error appear?

Post a example of the error.

OBS: only one correction in my solution - range C:E

Markmzz
 
Upvote 0
Conton,

Or try this (for Excel 2007 or 2010):

1) Select the range C:E.

2) And use CF formula =(SUM(C$1:C1)>0)*(COUNT($B1:$B$1048576;"INVENTORY IN")<1)

Or try this (for Excel 2003):


1) Select the range C:E.


2) And use CF formula =(SUM(C$1:C1)>0)*(COUNT($B1:$B$65536;"INVENTORY IN")<1)


Markmzz <!-- / message -->
 
Upvote 0
Conton,

Sorry, missed IF of the COUNTIF.

Now is correct.

Or try this (for Excel 2007 or 2010):

1) Select the range C:E.

2) And use CF formula =(SUM(C$1:C1)>0)*(COUNTIF($B1:$B$1048576,"INVENTORY IN")<1)

Or try this (for Excel 2003):

1) Select the range C:E.

2) And use CF formula =(SUM(C$1:C1)>0)*(COUNTIF($B1:$B$65536,"INVENTORY IN")<1)

Markmzz <!-- / message -->
 
Upvote 0

Forum statistics

Threads
1,224,608
Messages
6,179,872
Members
452,949
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