Formula Help

How_Do_I

Well-known Member
Joined
Oct 23, 2009
Messages
1,836
Office Version
  1. 2010
Platform
  1. Windows
How would I go about this please. I want to count and extract the items that are not listed in my Jeanie. So count the items that do not contain AA11-AA14 and extract those items please.

Excel Workbook
AAAB
11Mounted Troops4
12Artillery12
13Guards0
14Field Ambulances3
15Not the Above
Sheet1
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Would you post an input exhibit with a corresponding output exhibit without formulas, followed by a conscise description in words?
 
Upvote 0
Hello Aladin, what I'm after please are the Infantry Brigades that make up the 1st Division. This is a poor example because I could search "guards" and get the result but the search of "guards" would only work in some of the remaining Divisions in my workbook. So in the Jeanie, the Infantry Brigades are the ones NOT with the words "mounted" or "artillery" in the Brigade Range. The returns I seek are K2:K5, the row numbers of the 1st instance. I hope that clears it up.

Excel Workbook
ABCDEFGHIJ
11InfantryMountedArtilleryReturnsRange Row
2DivisionBrigade1st Division0221st Guards Brigade1
31st Division1st Guards Brigade2nd Guards Brigade3
41st Division1st Guards Brigade3rd Guards Brigade5
51st Division2nd Guards Brigade
61st Division2nd Guards Brigade
71st Division3rd Guards Brigade
81st Division3rd Guards Brigade
91st DivisionMounted Troops
101st DivisionMounted Troops
111st DivisionXXV Artillery Brigade
121st DivisionXXVI Artillery Brigade
Sheet1
#VALUE!
</td></tr></table></td></tr></table>
 
Upvote 0
Create unique brigades

where the conditions are:

1st Division

& not

infantry
mounted
artillery

in the 'brigade' description.
 
Upvote 0
Create unique brigades

where the conditions are:

1st Division

& not

mounted
artillery

in the 'brigade' description.

I need to specify want NOT to extract as opposed to what to extract.
 
Upvote 0
[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][td]
I​
[/td][td]
J​
[/td][/tr][tr][td]
1​
[/td][td][/td][td][/td][td]
[/td][td][/td][td]
[/td][td][/td][td]distinct brigade list[/td][td]Range Row[/td][/tr]
[tr][td]
2​
[/td][td]Division[/td][td]Brigade[/td][td]1st Division[/td][td]
Mounted
[/td][td]
Artillery
[/td][td]
3
[/td][td]1st Guards Brigade[/td][td]
1
[/td][/tr]
[tr][td]
3​
[/td][td]1st Division[/td][td]1st Guards Brigade[/td][td][/td][td][/td][td][/td][td][/td][td]2nd Guards Brigade[/td][td]
3
[/td][/tr]
[tr][td]
4​
[/td][td]1st Division[/td][td]1st Guards Brigade[/td][td][/td][td][/td][td][/td][td][/td][td]3rd Guards Brigade[/td][td]
5
[/td][/tr]
[tr][td]
5​
[/td][td]1st Division[/td][td]2nd Guards Brigade[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
6​
[/td][td]1st Division[/td][td]2nd Guards Brigade[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
7​
[/td][td]1st Division[/td][td]3rd Guards Brigade[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
8​
[/td][td]1st Division[/td][td]3rd Guards Brigade[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
9​
[/td][td]1st Division[/td][td]Mounted Troops[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
10​
[/td][td]1st Division[/td][td]Mounted Troops[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
11​
[/td][td]1st Division[/td][td]XXV Artillery Brigade[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
12​
[/td][td]1st Division[/td][td]XXVI Artillery Brigade[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


In F2 control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-($B$3:$B$12=""),IF($A$3:$A$12=$C$2,IF(1-ISNUMBER(SEARCH(" "&$D$2&" "," "&$B$3:$B$12&" ")),IF(1-ISNUMBER(SEARCH(" "&$E$2&" "," "&$B$3:$B$12&" ")),MATCH("~"&$B$3:$B$12,$B$3:$B$12&"",0))))),ROW($B$3:$B$12)-ROW($B$3)+1),1))

In I2 control+shift+enter, not just enter, and copy down:

=IF(ROWS($I$2:I2)>$F$2,"",INDEX($B$3:$B$12,SMALL(IF(FREQUENCY(IF(1-($B$3:$B$12=""),IF($A$3:$A$12=$C$2,IF(1-ISNUMBER(SEARCH(" "&$D$2&" "," "&$B$3:$B$12&" ")),IF(1-ISNUMBER(SEARCH(" "&$E$2&" "," "&$B$3:$B$12&" ")),MATCH("~"&$B$3:$B$12,$B$3:$B$12&"",0))))),ROW($B$3:$B$12)-ROW($B$3)+1),ROW($B$3:$B$12)-ROW($B$3)+1),ROWS($I$2:I2))))

In J2 just enter and copy down:

=IF($I2="","",MATCH($I2,$B$3:$B$12,0))
 
Upvote 0
Absolutely brilliant Aladin, placed in my workbook and it is working, thank you so much for that.

I don't understand the IF(1-ISNUMBER though... I assume it is the same as <>?

Thanks again.
 
Upvote 0
Absolutely brilliant Aladin, placed in my workbook and it is working, thank you so much for that.

You are welcome.

I don't understand the IF(1-ISNUMBER though... I assume it is the same as <>?

Thanks again.

Yes, it is depending how it's used:

1-(range="") is the same as range<>""

1-ISNUMBER(MATCH(...)) is the same as ISNA(MATCH(...))

1-ISNUMBER(SEARCH(...)) is the same as e.g., NOT(ISNUMBER(SEARCH(...))), etc.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

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