Formula help: Matching text and doing a calculation

  • Thread starter Thread starter JK_KS01_W
  • Start date Start date
J

JK_KS01_W

Hi all,

I was hoping that someone here could help me out with a formula. I
trying to make a spreadshee for my checkbook and i want to include
rows (Fun, Food, Gasoline, Insurance) and in these rows I want to pu
a formula that looks at my description of a entry (C#) for the key wor
(say Food) then carrys out a formula that takes the cell above it (sa
food col. was H) adds it too E Col. of that row and spits out a total
I tried something like this.

=IF(C1="Food") then (H2=(H1+E2)) else (H2= 0)

Sorry if this isn't too clear, rather new to excel :)

Thanks
Jedediah Klusman
(e-mail address removed)
 
Still geting a NAME? error in the cell. looking for an example of
"IF, THEN, ELSE" statment prob. would be a good place to start, so
guess ill do somedigging tonight.
However, any of you get a idea that might help, plz let me know. An
thanks for the quick reply ben.

Thanks again
Jedediah Klusman
(e-mail address removed)
 
JK_KS01_W said:
*Still geting a NAME? error in the cell. looking for an example of
"IF, THEN, ELSE" statment prob. would be a good place to start, so
guess ill do somedigging tonight.
However, any of you get a idea that might help, plz let me know. An
thanks for the quick reply ben.

Thanks again
Jedediah Klusman
(e-mail address removed) *

One possible reason I can think of why you are getting a NAME error i
Cell H2 (assuming that there are no misspelled words in your columns
is that the word "Food" is not in "quotes" in the formula

=if(C1="Food",H1+E2,0)

otherwise, it should work (as I tested it).

Also, allow me to breakdown the above formula to conform with you
"IF/THEN/ELSE" format:

1. IF cell C1 contains the word "Food"

2. THEN add the contents of cells H1 and E2

3. ELSE a value of 0 should be in the cell H2.

I guess this is the what I can do with the data that you have given
 
Got it! yay thanks for the help man. Ok so heres what i figured out a
i went along the guidelines of your formula. First problem, with th
name? was occureing due to =if(C1="Food",H1+E2,0) instead o
=if(C1="Food";H1+E2;0). Im using openoffice.org so i bet they change
it to semi-colons to seperate the if, then, and else statements.
Second problem after i fixed that was i couldn't get it to match th
text in C Col. I had a text string in the Col. of "Chevron: Snacks" o
"Amoco BP: Snacks", i couldn't get it to match just one piece of th
string "Snacks" so I made a new Col. labled it Catagory and just pu
"Snacks" or "Food" into it and used that Col. to match.

Thanks again for the quick reply, and helping me work through thi
error. Now i got a new one for you, Im trying to write a spreadshee
to track the credits i have earned in school. I want to make th
Total's Cell's background to change from red to green when the tota
match's the above cell's value.

Thanks again,
Jedediah Klusma
 
<< Im trying to write a spreadsheet to track the credits i have earne
in school. I want to make the Total's Cell's background to change fro
red to green when the total match's the above cell's value.

Thanks again,
Jedediah Klusman >>

Go to

FORMAT -- Conditional Formatting

to solve this
 
Jedediah

If Ben's formula returns #NAME? you are not entering it correctly.

Perhaps you have typoed an l(ell) instead of a 1(one) in your formula.

Otherwise, it works for me as advertised.

Gord Dibben Excel MVP
 
Back
Top