Countif or Sumif or Match? Counting exponents that are labels but weird results

montyfern

Board Regular
Joined
Oct 12, 2017
Messages
65
Good Day All!

Close but no cigar? VBA? Pivots? I have a list with labels where I need to count every instance of ^ or exponents that's embedded in individual cells. It will constantly change. I tried the following formulas: [TABLE="width: 64"]
<tbody>[TR]
[TD="align: right"]=COUNTIFS(A2:D2,"*^*") =SUMIF(A2:D2,"*^*",$E$2:$E$11)
=MATCH("^",A2:D11,0)-MATCH("^",A2:D11,0)-3 which gives the dreaded N/A error.
[/TD]
[/TR]
</tbody>[/TABLE]

For example:
[TABLE="width: 576"]
<tbody>[TR]
[TD]SO
[/TD]
[TD]Support
[/TD]
[TD]Type of Meeting
[/TD]
[TD]Mechanic
[/TD]
[TD]Count
[/TD]
[TD]Total
[/TD]
[/TR]
[TR]
[TD]Reginald Smith^2
[/TD]
[TD]B. Lawford ^
[/TD]
[TD]F2F
[/TD]
[TD]R13
[/TD]
[TD="align: right"]2
[/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD]Patricia Jones ^1
[/TD]
[TD]P. Redland
[/TD]
[TD]Tele.
[/TD]
[TD]U19
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]2
[/TD]
[/TR]
[TR]
[TD]Sidney Poitier ^2
[/TD]
[TD]P. Newton
[/TD]
[TD]F2F
[/TD]
[TD]R02
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]2
[/TD]
[/TR]
[TR]
[TD]Elizabeth Taylor ^2
[/TD]
[TD]E. Hernandez
[/TD]
[TD]Tele.
[/TD]
[TD]U19
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]2
[/TD]
[/TR]
[TR]
[TD]Paul Newman ^2
[/TD]
[TD]S. DeLorean
[/TD]
[TD]Tele.
[/TD]
[TD]R13
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]2
[/TD]
[/TR]
[TR]
[TD]Robert Redford
[/TD]
[TD]T. Manilow
[/TD]
[TD]F2F
[/TD]
[TD]U19
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD]Cecily Tyson ^2
[/TD]
[TD]J. Johnson
[/TD]
[TD]F2F
[/TD]
[TD]U19
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]2
[/TD]
[/TR]
[TR]
[TD]Robert Redford
[/TD]
[TD]W. Washington
[/TD]
[TD]Tele.
[/TD]
[TD]R02
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD]Paul Newman ^2
[/TD]
[TD]K. Kowalski
[/TD]
[TD]F2F
[/TD]
[TD]U19 ^
[/TD]
[TD="align: right"]2
[/TD]
[TD="align: right"]2
[/TD]
[/TR]
[TR]
[TD]Barry Jones ^3
[/TD]
[TD]S. DeLorean ^
[/TD]
[TD]Tele. ^
[/TD]
[TD]R13
[/TD]
[TD="align: right"]3
[/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD]Aggregate Sum
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]12
[/TD]
[TD="align: right"]12
[/TD]
[/TR]
[TR]
[TD]Then, I have simple sums which both denote 12 as you can see. Thanks so much.
[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Problem is: See Barry Jones has ^3? Three exponents? Countif's and Sumif's only count ONE instance of the exponent. I need a total of EVERY instance of ^ going ACROSS. So, the Barry Jones line should total FIVE not three. Barry has 3 ^, S. Delorean has one, Tele. has one. There's only FOUR columns: SO, Support, Type of Meeting & Mechanic. Does this make sense?
 
Upvote 0
I assumed the first column only would have a caret followed by an integer; columns B through D can have a caret but no integer. I also assumed the integer could go above 9.

I hope this helps.


Book1
ABCDE
1SOSupportType of MeetingMechanicTotal
2Reginald Smith^2B. Lawford ^F2FR133
3Patricia Jones ^10P. RedlandTele.U1910
4Sidney Poitier ^2P. NewtonF2FR022
5Elizabeth Taylor ^2E. HernandezTele.^U193
6Paul Newman ^2S. DeLorean^Tele.R13^4
7Robert RedfordT. ManilowF2FU190
8Barry Jones ^3S. DeLorean ^Tele. ^R135
Sheet1
Cell Formulas
RangeFormula
E2=COUNTIF(B2:D2, "*^*") + IFERROR(--RIGHT(A2, LEN(A2) - SEARCH("^", A2)), 0)
 
Upvote 0
Perfecto thisoldman! I've never used IFERROR & it's years since RIGHT, LEN & SEARCH. *Wow.* ^ ;) Read my Mr. Excel book (Power Excel) and the question starts with: "Using Left, Mid, Right, Find, and Len make my head hurt." Haha I feel their pain but in this case your solution is using them & superb! UBER thanks!
--montyfern
 
Upvote 0
He added new criteria where the formula doesn't work: REVIEW MECHANISM LIST


Mechanism
Reviewable Unit #s

N01s (Contract Proposals)

3 pts for each Contract Proposal

Example:
1 N01= 3
2 NO1s = 6
D43, F30 – F35, G11, K01, K02, K08, K11, K22 - K25, K30, K99, L30, L40, N43, P20, R00, R01, R03, R09, R13, R15, R18, R21, R21/R33, R24, R25, R33, R34, R37, R38, R38/K38, R41 – R44, R61/R33, UC1, UC4, UC6, UC7, U56, U44, U42, U24, U19, U01, T35, T32, SI2/R00, SC2, SC1,SB, RC1, UG3/UH3, UH2, UH2/UH3, UT2, X02, Y01, Y02


1 pt for each single-project application

Example:
1 R01= 1
2 K23s, 1 K22, 1 R03 = 4

U19, P01, UM1, UM2, U54, SI2, P30, P50

5 pts for each multi-project applications

Example:
1 P01= 5
2 U19s = 10
1 U19, 3 PO1s = 20

<tbody>
</tbody>

Now I have to add these exact points .. can you help again please?
 
Upvote 0
What does the hyphen mean in "F30 - F35"? Perhaps it stands for F30, F31, F32, F33, F34, F35?
What is the significance of the slash, as in "R21/R33"?
What's to be done if the mechanism has a carat?

I think another small solved example, is needed.
 
Upvote 0
What does the hyphen mean in "F30 - F35"? Perhaps it stands for F30, F31, F32, F33, F34, F35?
What is the significance of the slash, as in "R21/R33"?
What's to be done if the mechanism has a carat?

I think another small solved example, is needed.

I'm thinking a macro with sumbycolor? Seems too complex to count various carats in various cells, some together. However,
1. Thanks for your quick answer. Yes, to F30 (F30, F31, F32, F33, F34, F35).
2. He means this: "There is only 7 to 10 multi-project mechanisms and they are worth 5 points each. The N01 is classified as a contract and not a grant and its worth 3. The rest are worth 1 point." The slash threw me off too.

What do you think?
 
Upvote 0
How about a lookup table or two?

You have U19 in both the 1-point and the 3-point lists. I removed it from the 1-point list for testing. The 1-point lists extends from cell G2 to cell G67—I don't show the complete list below.

If a mechanism doesn't appear in either list, and is not 'N01', no points are counted.


Book1
ABCDEFGH
1SOSupportMeeting TypeMechanismTotal1 Point3 Point
2Reginald Smith^2B. Lawford ^F2FR134D43P01
3Patricia Jones ^10P. RedlandTele.U1913F30P30
4Sidney Poitier ^2P. NewtonF2FR022F31P50
5Elizabeth Taylor ^2E. HernandezTele.^U196F32SI2
6Paul Newman ^2S. DeLorean^Tele.N01^9F33U19
7Robert RedfordT. ManilowF2FU193F34U54
8Barry Jones ^3S. DeLorean ^Tele. ^R136F35UM1
9G11UM2
Sheet1
Cell Formulas
RangeFormula
E2=COUNTIF(B2:D2, "*^*") + IFERROR(--RIGHT(A2, LEN(A2) - SEARCH("^", A2)), 0) + 5 * (SUBSTITUTE(D2, "^", "") = "N01") + 3 * ISNUMBER(MATCH(SUBSTITUTE(D2, "^", ""), $H$2:$H$9, 0)) + ISNUMBER(MATCH(SUBSTITUTE(D2, "^", ""), $G$2:$G$67, 0))
 
Upvote 0
I must be doing something wrong, as the No1's are 5 points and the U19's are 3. I played around, transposing your 5's & 3's. When I add a ^ it adds a point. Can I send you the file to a DropBox site location? Thanks so much!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top