Isolating letters for a formula

  • Thread starter Thread starter Anto111
  • Start date Start date
A

Anto111

Hi guys,

I am currently applying the following formula to a speadsheet:

=IFERROR(SUMPRODUCT(--(B6:B33="F DEF"),K6:K33)/SUMPRODUCT(--(B6:B33="F
DEF"),--(K6:K33>0)),"-")

In a seperate formula I have also replaced "F DEF" with "C DEF" to return a
different value. What I would now like to do is create a similar formula that
incorparates both sets of data into one formula by identifying only the last
three letters, i.e "DEF".

Any ideas would be greatly appreciated.

Thanks in advance,

Ant
 
Hi,

thanks for that, just been reading up on that by coincidence but not sure
how to incorparate it into the formula?

Cheers for your time,

Ant
 
Try this:

=IFERROR(SUMPRODUCT(--(RIGHT(B6:B33,3)="DEF"),K6:K33)/SUMPRODUCT(--(RIGHT(B6:B33,3)="DEF"),--(K6:K33>0)),"-")

Or, maybe this:

=IFERROR(SUMIF(B6:B33,"*DEF",K6:K33)/COUNTIFS(B6:B33,"*DEF",K6:K33,">0"),"-")
 
You could either nest your original formula in RIGHT like this:
=RIGHT(IFERROR(SUMPRODUCT(--(B6:B33="F DEF"),K6:K33)/SUMPRODUCT(--(B6:B33="F
DEF"),--(K6:K33>0)),"-"),3)

or use RIGHT to refer to what you have now from another cell. So if your
=IFERROR(SUMPRODUCT(--(B6:B33="F DEF"),K6:K33)/SUMPRODUCT(--(B6:B33="F
DEF"),--(K6:K33>0)),"-") formula is in A1, use =RIGHT(A1,3) where you want it
to go.
 
T. Valko, your an absolute magician,

thank you.

T. Valko said:
Try this:

=IFERROR(SUMPRODUCT(--(RIGHT(B6:B33,3)="DEF"),K6:K33)/SUMPRODUCT(--(RIGHT(B6:B33,3)="DEF"),--(K6:K33>0)),"-")

Or, maybe this:

=IFERROR(SUMIF(B6:B33,"*DEF",K6:K33)/COUNTIFS(B6:B33,"*DEF",K6:K33,">0"),"-")
 

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

Back
Top