Simplicity is Desired

  • Thread starter Thread starter natei6
  • Start date Start date
N

natei6

Hi to all,

=SUM(((COUNTIF(E20:J20,"a")+COUNTIF(E20:J20,"I"))*10+(COUNTIF(K20:P20,"a")+COUNTIF(K20:P20,"I"))*20+(COUNTIF(Q20:S20,"a")+COUNTIF(Q20:S20,"I"))*30+(COUNTIF(T20:W20,"a")+COUNTIF(T20:W20,"I"))*20))/2

This formula that I have put together gets the desired result, but I am
seeking a simpler version. Many thanks.
Nate.
 
A (very little) bit shorter:
=((COUNTIF(E20:J20,"a")+COUNTIF(E20:J20,"I"))*10+(COUNTIF(K20:P20,"a")+COUNT
IF(K20:P20,"I"))*20+(COUNTIF(Q20:S20,"a")+COUNTIF(Q20:S20,"I"))*30+(COUNTIF(
T20:W20,"a")+COUNTIF(T20:W20,"I"))*20)/2

since the SUM function is unnecessary

HTH
 
Thanks, very much.
I am curious, would a sumproduct function achieve the same result? I
also have another fomula that is similar, only with an if function
added.

=IF((COUNTIF(E5:W5,"a")+COUNTIF(E5:W5,"i")>5),10+(COUNTIF(E5:J5,"a")+COUNTIF(E5:J5,"i"))*10+(COUNTIF(K5:P5,"a")+COUNTIF(K5:P5,"i"))*20+(COUNTIF(Q5:S5,"a")+COUNTIF(Q5:S5,"I"))*30+(COUNTIF(T5:W5,"a")+COUNTIF(T5:W5,"i"))*20,(COUNTIF(E5:J5,"a")+COUNTIF(E5:J5,"i"))*10+(COUNTIF(K5:P5,"a")+COUNTIF(K5:P5,"i"))*20+(COUNTIF(Q5:S5,"a")+COUNTIF(Q5:S5,"i"))*30+(COUNTIF(T5:W5,"a")+COUNTIF(T5:W5,"i"))*20)


Thanks again,
Nate
 
Thanks, very much.
I am curious, would a sumproduct function achieve the same result? I
also have another fomula that is similar, only with an if function
added.

=IF((COUNTIF(E5:W5,"a")+COUNTIF(E5:W5,"i")>5),10+(COUNTIF(E5:J5,"a")+COUNTIF(E5:J5,"i"))*10+(COUNTIF(K5:P5,"a")+COUNTIF(K5:P5,"i"))*20+(COUNTIF(Q5:S5,"a")+COUNTIF(Q5:S5,"I"))*30+(COUNTIF(T5:W5,"a")+COUNTIF(T5:W5,"i"))*20,(COUNTIF(E5:J5,"a")+COUNTIF(E5:J5,"i"))*10+(COUNTIF(K5:P5,"a")+COUNTIF(K5:P5,"i"))*20+(COUNTIF(Q5:S5,"a")+COUNTIF(Q5:S5,"i"))*30+(COUNTIF(T5:W5,"a")+COUNTIF(T5:W5,"i"))*20)


Thanks again,
Nate
 
Hi!

A little bit shorter.....

Entered as an array using the key combo of CTRL,SHIFT,ENTER:

=SUM(((E20:J20="a")+(E20:J20="I"))*10,((K20:P20="a")+(K20:P20="I"))*20,((Q20:S20="a")+(Q20:S20="I"))*30,((T20:W20="a")+(T20:W20="I"))*20)/2

Biff
 
natei6 wrote...
....
=SUM(((COUNTIF(E20:J20,"a")+COUNTIF(E20:J20,"I"))*10+(COUNTIF(K20:P20,"a")
+COUNTIF(K20:P20,"I"))*20+(COUNTIF(Q20:S20,"a")+COUNTIF(Q20:S20,"I"))*30
+(COUNTIF(T20:W20,"a")+COUNTIF(T20:W20,"I"))*20))/2

This formula that I have put together gets the desired result, but I am
seeking a simpler version. Many thanks.

All the ranges span only row 20, and all columns between col E and col
W are involved, and all cells are compared against the same set of
strings.

Try

=SUMPRODUCT((E20:W20={"a";"I"})
*LOOKUP(COLUMN(E20:W20),{5;11;17;20},{10;20;30;20}))/2
 
Thankyou Harlan,
That seems to work very nicely, will a similar arrangement work wit
this formula? If so, how?
=IF((COUNTIF(E5:W5,"a")+COUNTIF(E5:W5,"i"))>5,10+SUM(((E5:J5="a")+(E5:J5="i"))*10,((K5:P5="a")+(K5:P5="I"))*20,((Q5:S5="a")+(Q5:S5="I"))*30,((T5:W5="a")+(T5:W5="I"))*20),SUM(((E5:J5="a")+(E5:J5="i"))*10,((K5:P5="a")+(K5:P5="i"))*20,((Q5:S5="a")+(Q5:S5="i"))*30,((T5:W5="a")+(T5:W5="i"))*20))

Thanks,
Nate
 
natei6 wrote...
....
. . . will a similar arrangement work with
this formula? If so, how?

=IF((COUNTIF(E5:W5,"a")+COUNTIF(E5:W5,"i"))>5,10+
SUM(((E5:J5="a")+(E5:J5="i"))*10,((K5:P5="a")+(K5:P5="I"))*20,
((Q5:S5="a")+(Q5:S5="I"))*30,((T5:W5="a")+(T5:W5="I"))*20),
SUM(((E5:J5="a")+(E5:J5="i"))*10,((K5:P5="a")+(K5:P5="i"))*20,
((Q5:S5="a")+(Q5:S5="i"))*30,((T5:W5="a")+(T5:W5="i"))*20))
....

First, (COUNTIF(E5:W5,"a")+COUNTIF(E5:W5,"i"))>5 could be replaced with

SUM(COUNTIF(E5:W5,{"a","i"}))>5

The only difference between the TRUE and FALSE results is the 10+ in
the TRUE result. Which means your formula is equivalent to

=IF(SUM(COUNTIF(E5:W5,{"a","i"}))>5,10,0)
+SUM(((E5:J5="a")+(E5:J5="i"))*10,((K5:P5="a")+(K5:P5="I"))*20,
((Q5:S5="a")+(Q5:S5="I"))*30,((T5:W5="a")+(T5:W5="I"))*20)

Then replace the first two lines with my formula, so

=IF(SUM(COUNTIF(E5:W5,{"a","i"}))>5,10,0)+SUMPRODUCT((E20:W20={"a";"i"})
*LOOKUP(COLUMN(E20:W20),{5;11;17;20},{10;20;30;20}))
 

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