IF statement to calculate based on cell values

G

Guest

I am trying to get a cell to run a multiplication calculation on two cells
(i17 and k17), where one cell (b17) contains a fixed value ("S") or b17
contains a fixed value ("F") AND c17 has a value greater than 3. can anyone
help me with the expression I should use?
 
J

Jason Lepack

=SUMPRODUCT(((--(B17="S"))+(--(B17="F")))*--(C17>=3)*(I17*K17))

+ is OR
* is AND
-- converts a TRUE to a 1

or

=IF(AND(OR(B17="S",B17="F"),C17>=3),I17*K17,0)
 
G

Guest

....and...another option:

=IF(AND(OR((B17={"S","F"})),C17>3),I17*K17,"")

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
G

Guest

Hi Ron,

many thanks for your help. It works for the clause where B17="F" and C17>3
but i17*k17 should apply just where b17="S" (ie. C17 doesn't have to be
greater than 3 with the value "S")

Jo x
 
G

Guest

Hi Jason,

This works fine but the multiplaction between i17 and k17 happens just when
b17="S". The link to c17 being greater than 3 only applies when the value in
B17 ="F".

Jo xx
 
G

Guest

OK....how about this:

=IF(OR(B17="S",AND(B17="F",C17>3)),I17*K17,"")

or, maybe this
=((B17="S")+(B17="F")*(C17>3))*(I17*K17)

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
G

Guest

Hi Ron,

yes - thank you!

Jo xx

Ron Coderre said:
OK....how about this:

=IF(OR(B17="S",AND(B17="F",C17>3)),I17*K17,"")

or, maybe this
=((B17="S")+(B17="F")*(C17>3))*(I17*K17)

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top