Excel formula help
Hey,
I have the following table.
A | B | C | D | E | F | G | H | I | J | K | L | M | N |
IP Address | CIDR | Netmask | Start IP | End IP | Broadcast IP | # of Hosts | 1st OCT | 2st OCT | 3st OCT | IP Start | IP End | Country | Type |
1 | 2 | 3 | 4 | 4 | |||||||||
10.16.215.0 | 24 | 255.255.255.0 | 10.16.215.1 | 10.16.215.254 | 10.16.215.255 | 254 | 10 | 16 | 215 | 1 | 254 | HU | Server |
10.17.215.0 | 24 | 255.255.255.0 | 10.17.215.1 | 10.17.215.254 | 10.17.215.255 | 254 | 10 | 17 | 215 | 1 | 254 | AT | Image Device |
10.10.170.23 | 28 | 255.255.255.240 | 10.10.170.17 | 10.10.170.30 | 10.10.170.31 | 14 | 10 | 10 | 170 | 17 | 30 | SI | IOT |
10.11.1.0 | 24 | 255.255.255.0 | 10.11.1.1 | 10.11.1.254 | 10.11.1.255 | 254 | 10 | 11 | 1 | 1 | 254 | CRO | External Managed Devices |
10.10.32.0 | 27 | 255.255.255.224 | 10.10.32.1 | 10.10.32.30 | 10.10.32.31 | 30 | 10 | 10 | 32 | 1 | 30 | HU | Maxnet card readers |
10.10.32.64 | 26 | 255.255.255.192 | 10.10.32.65 | 10.10.32.126 | 10.10.32.127 | 62 | 10 | 10 | 32 | 65 | 126 | HU | Whatever |
These are IP adressess (in A) and i have already broken them down into ranges - column K and L
In a seperate field i want to compare the values in this table column H-L with an IP address (4 seperate columns e.g. 10.16.215.2 to 4 columns 10 16 215 2) and find the exact row where the IP addrss is matching.
In other words - I want to create a search field where someone puts an IP address - it is then converted into 4 columns for the octets (i know how to do that) and then compared/matched with the 4 numbers in the table from column H-L by also making sure that the 4th searched number is within the range of K-L. I want to return Column M and N as a result.
My goal is a searchable database where one can put in an IP and immadietely sees the country and the type/description without manually going through the list.
I have tried
=IF(AND(U15>=$K3, U15<=L3), IF(COUNTIF(H2:H6,R15)+COUNTIF(I2:I6,S15)+COUNTIF(J2:J6,T15)>=3, "Match", "Not Match"), "Not Match")
But this is not really the solution as it does not search in the whole column and it just returns Match or NO Match. Also tried with Vlookup but i am lost at this point.
Any help is appriciated, i am not great with functions in general unfortunately.
Thanks a lot
On Excel 365, and if I understood the logic correctly, that could be
=XLOOKUP( 1, (TEXTBEFORE($A12,".",3) = TEXTBEFORE($D$3:$D$8,".",3)) * (--TEXTAFTER($A12,".",3) >= --TEXTAFTER($D$3:$D$8,".",3)) * (--TEXTAFTER($A12,".",3) <= --TEXTAFTER($E$3:$E$8,".",3)), $N$3:$N$8, "no such" )