Conditional Formatting of Cells based on value of 1 cell - can it be done?

L

Legacy 319150

Guest
Hi, this is my first post!. I have a problem that has baffles me and now its time to ask for help - hopefully someone here will be able to tell me if what i want/need is possible or not. It may be really simple or impossibly hard - but i have exhaused all of what i am able to do to get this to work.

What I need is a way of using conditional formatting or VBA (I have very limited knowledge of code) to highlight the cells that cumulatively equal the number of the current stock level, turning the cells green until they match the total then all cells beyond this (colums to the right) turn red. The Purpose of this is to highlight to a customer when the current stock held for their account will run out if not replenished. The columns D:M are sites in the schedule and the rows are the product lines. A Report needs to be issued daily and at present this is a manual task. I have approximately 100 sites at any one time and nearly 200 product lines so takes a vast amount of time to complete the report. The customer wants this visual format so they can easily see the state of the current stock position. The Table below is a sample of what i am working with. I am trying to achieve an automated way so if I update the stock column a Red/Green colour is applied if I have the stock or not. - Is this Possible?

What i have...
Site 1</SPAN>Site 2</SPAN>Site 3</SPAN>Site 4</SPAN>Site 5</SPAN>Site 6</SPAN>Site 7</SPAN>Site 8</SPAN>Site 9</SPAN>Site 10</SPAN>
Part Number</SPAN>Description</SPAN>Current Stock</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>Rqd Qty</SPAN>
1806501024</SPAN>Part One</SPAN>15</SPAN>5</SPAN>10</SPAN>12</SPAN>52</SPAN>34</SPAN>41</SPAN>7</SPAN>11</SPAN>27</SPAN>52</SPAN>
1806501025</SPAN>Part Two</SPAN>84</SPAN>11</SPAN>33</SPAN>30</SPAN>40</SPAN>29</SPAN>19</SPAN>51</SPAN>36</SPAN>24</SPAN>16</SPAN>
1806501026</SPAN>Part Three</SPAN>34</SPAN>8</SPAN>13</SPAN>26</SPAN>10</SPAN>45</SPAN>14</SPAN>53</SPAN>11</SPAN>53</SPAN>50</SPAN>
1806501027</SPAN>Part Four</SPAN>178</SPAN>33</SPAN>16</SPAN>54</SPAN>38</SPAN>35</SPAN>16</SPAN>34</SPAN>21</SPAN>29</SPAN>23</SPAN>
1806501028</SPAN>Part Five</SPAN>48</SPAN>4</SPAN>12</SPAN>15</SPAN>37</SPAN>44</SPAN>7</SPAN>26</SPAN>7</SPAN>11</SPAN>43</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL><COL><COL><COL><COL span=7><COL></COLGROUP>
i can't upload a sample as you can't on this forum and i can't link to a picture/screen shot as i have no way of uploading a picture anywhere. i can however email a copy of a sample sheet if this is easier for anyone - please request from 4oakleigh@gmail.com




Any help would be a life saver!! Thank you in advance

Regards, Darren
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Im not sure if im on the right track here but if you try two formulas for formatting, do you get what you want then?

Select all the requested qty's, starting of in the top left.
Goto conditional formatting, format by formula
( I got swedish version so im not sure if the words are exact )

First formula for green ( D4 is the top left cell in my example and C4 is stock qty)
Code:
=SUM($D4:D4)<=$C4

Then add another formula for red
Code:
=SUM($D4:D4)>$C4
 
Upvote 0
Darren,

Welcome to MrExcel.

Assuming I understand correctly then maybe...
Excel Workbook
ABCDEFGHIJK
1Site 1Site 2Site 3Site 4Site 5Site 6Site 7Site 8
2Part NumberDescriptionCurrent StockRqd QtyRqd QtyRqd QtyRqd QtyRqd QtyRqd QtyRqd QtyRqd Qty
31806501024Part One1551012523441711
41806501025Part Two841133304029195136
51806501026Part Three34813261045145311
61806501027Part Four1783316543835163421
71806501028Part Five484121537447267
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D31. / Formula is =AND(D3<>"",SUM($D3:D3)>$C3)Abc
D32. / Formula is =AND(D3<>"",SUM($D3:D3)<=$C3)Abc



Hope that helps.
 
Upvote 0
Sorry for the delay in responding - thank you to 'Stridhan' for your comments - however from my explaination 'Snakehips' you rock - this is EXACTLY what i was trying to explain - i can't thank you enough.... i know there is always a way with Excel... its just find 'it' or 'someone' who is an excel Guru - you have saved me masses of time daily - THANK YOU!
Kind Regards, Darren
 
Upvote 0
Darren.

You are welcome. Glad we could help.

The only subtle difference between my formulas and Stridhan's is that mine will not highlight empty cells albeit that they might be subject to the Cfg.

Stridhan, I echo your signature notes.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

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