Wildcard use with COUNTIFS and alphanumeric search term?

rjyusmc2005

New Member
Joined
Dec 3, 2020
Messages
3
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Is there a more efficient way to do this, wildcards, different formula all together? Or is this just wishful thinking?
This is a condensed version of the formula I'm trying to streamline:

=G4-((COUNTIFS(B9:Y39,"S1")*1)+(COUNTIFS(B9:Y39,"S2")*2)+.......(COUNTIFS(B9:Y39,"S8")*8))

The "S#" value ranges from S1 to S8 and I currently have this string repeating for each potential value, which makes for a lengthy formula. The number (2 in S2) is also the value it needs to be multiplied by. Is there a way to extract that value and have it used as the multiplier? Count the cells that contain "S#", take the numerical value from that cell, "2" for example, and multiply the number of cells containing "S2" by that value. If there are 15 instances of S2, it should give a result of 30. This would need to be able to work for any value after the "S". If it's "S4" it would be multiplied by 4, "S6" would be multiplied by 6.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi & welcome to MrExcel.
You can do that like
Excel Formula:
=SUM(COUNTIFS(B9:Y39,{"S1","S2","S3"})*{1,2,3})
just expand the two arrays.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
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