So I've got two columns in excel. In column A, I have dollar amounts, and in column B, I have text, such as gas, grocery, etc. I want to shade column A a certain color depending on the corresponding value in column B (yellow for gas, red for grocery, etc). Any idea how to do this? I set the conditional formatting based on the formulas "IF(B1="gas", A1, A1)" and "IF(B1="grocery",A1,A1)" and set the shading to a different color. It worked for that cell, but when I copy it to another cell, it doesnt update the cell numbers. ie, when I use it on A2, it still evaluates it based on B1.
2006-09-01
11:49:59
·
5 answers
·
asked by
Manu
2
in
Computers & Internet
➔ Software
When I select multiple cells (like an entire column) and enter the formula(s) for the different formats, the numbers dont update themselves :-\ for instance, here are the two columns:
A B
$4.00 gas
$5.00 grocery
I highlight column A, go to conditional formatting, for the first formula, I enter "=B1="gas"". in the second formula box, I enter "=B1="grocery"". I would hope that for cell A1, it would evaluate the formulas based on B1, and for cell A2, it would evaluate the formulas based on B2...but it doesnt :( and its driving me crazy, because it SHOULD be simple.
2006-09-01
12:10:58 ·
update #1
Nevermind, figured it out. Turns out the $ that excel automatically inserted for me keep that part of the cell "address" the same, so $A$1 kept both the same, but $A1 would just keep the letter the same, so =$K$2933="woodys" didnt work, but =$K2933="woodys" did. Yay! Now I need to find a couple other things, like how to do that, but if the corresponding cell in col B _contains_ a certain string (like lets say B contains entries like "shell gas"), and conditionally add numbers in a column based on another column (so I can easily add my gas expenses for a month, etc), but those should be A LOT easier...well, the first one, at least.
2006-09-01
12:46:55 ·
update #2
for anyone wondering, here's what I ended up doing.
for highlighting any cell in column A that corresponds to a gas charge in column B (even if the cell contains other words, such as "rent/gas" for two charges):
=ISNUMBER(FIND("gas",$B1))
That scans the entire cell for an occurance of "gas".
To add up all gas purchaces for a given period of time, I used:
=SUMIF(B2:B29,"*gas*",A2:A29)
By using the wildcard characters, I ensured that I'd get the right values.
2006-09-05
05:55:58 ·
update #3