Excel formula

Copper Contributor

Hi I'm wanting to create a formula where I want something like this.

if C2+E2+H2 = B2 and J2=a then n2=a or r if not true.

 

I've gone through the tutorials but it's just doing my head in and I can't work it out.

any help would be greatly appreciated.

 

Many thanks

 

Wobly

5 Replies

hi @woblypegs 

 

You can use below formula

=IF(AND(C2+E2+H2=B2,J2=A2),A2,R2)

Sample file is also attached for your reference.

Tauqeer

@woblypegs 

 

As per your description, please try this...

In N2

=IF(AND(SUM(C2,E2,H2)=A2,J2="a"),"a","r")

 

The advantage of using SUM(C2,E2,H2) over C2+E2+H2 is, if in any case C2 or E2 or H2 contains a text string or a null string returned by another formula, C2+E2+H2 will throw an error as you cannot add a string to a number whereas SUM(C2,E2,H2) will ignore the text values.

Thank You very much.

Wobly
Thank you very much.

Wobly

You're welcome Wobly!

 

Subodh