Hoppa till huvudinnehåll

Hur returnerar jag ett värde om ett visst värde finns i ett visst intervall i Excel?

Som den vänstra skärmdumpen visas, om ett visst nummer 5 är inom ett visst antalintervall, hur man returnerar värdet i den intilliggande cellen. Formelmetoden i den här artikeln kan hjälpa dig att uppnå den.

Returnera ett värde om ett visst värde finns i ett visst intervall med hjälp av en formel


Returnera ett värde om ett visst värde finns i ett visst intervall med hjälp av en formel

Använd följande formel för att returnera ett värde om ett visst värde finns i ett visst område i Excel.

1. Välj en tom cell, ange formel = VLOOKUP (E2, A2: C8,3, TRUE) in i formelfältet och tryck sedan på ange nyckel. Se skärmdump:

Du kan se att det angivna numret 5 är i nummerområdet 4-6, sedan motsvarar motsvarande värde Addin 012 i intilliggande cell omedelbart i den valda cellen som ovanstående skärmdump visade.

Obs! I formeln är E2 cellen innehåller det angivna numret, A2: C8 innehåller nummerintervallet och det värde du kommer att returnera baserat på det angivna numret, och nummer 3 betyder att värdet du kommer att returnera lokaliseras i den tredje kolumnen i intervall A2: C8. Ändra dem baserat på ditt behov.


Relaterade artiklar:

Bästa kontorsproduktivitetsverktyg

🤖 Kutools AI Aide: Revolutionera dataanalys baserat på: Intelligent utförande   |  Generera kod  |  Skapa anpassade formler  |  Analysera data och generera diagram  |  Anropa Kutools funktioner.
Populära funktioner: Hitta, markera eller identifiera dubbletter   |  Ta bort tomma rader   |  Kombinera kolumner eller celler utan att förlora data   |   Rund utan formel ...
Superuppslag: Flera kriterier VLookup    VLookup med flera värden  |   VSök över flera ark   |   Fuzzy Lookup ....
Avancerad rullgardinslista: Skapa snabbt en rullgardinslista   |  Beroende rullgardinslista   |  Flervals-rullgardinslista ....
Kolumnhanterare: Lägg till ett specifikt antal kolumner  |  Flytta kolumner  |  Växla synlighetsstatus för dolda kolumner  |  Jämför intervall och kolumner ...
Utvalda funktioner: Rutnätsfokus   |  Designvy   |   Stor formelbar    Arbetsbok & Bladhanterare   |  Resursbibliotek (Automatisk text)   |  Datumväljare   |  Kombinera arbetsblad   |  Kryptera/Dekryptera celler    Skicka e-postmeddelanden efter lista   |  Superfilter   |   Specialfilter (filtrera fet/kursiv/genomstruken...) ...
Topp 15 verktygssatser12 text verktyg (lägga till text, Ta bort tecken, ...)   |   50+ Diagram Typer (Gantt Chart, ...)   |   40+ Praktiskt Formler (Beräkna ålder baserat på födelsedag, ...)   |   19 Införande verktyg (Infoga QR-kod, Infoga bild från sökväg, ...)   |   12 Konvertering verktyg (Siffror till ord, Valutaväxling, ...)   |   7 Slå ihop och dela verktyg (Avancerade kombinera rader, Dela celler, ...)   |   ... och mer

Uppgradera dina Excel-färdigheter med Kutools för Excel och upplev effektivitet som aldrig förr. Kutools för Excel erbjuder över 300 avancerade funktioner för att öka produktiviteten och spara tid.  Klicka här för att få den funktion du behöver mest...

Beskrivning


Fliken Office ger ett flikgränssnitt till Office och gör ditt arbete mycket enklare

  • Aktivera flikredigering och läsning i Word, Excel, PowerPoint, Publisher, Access, Visio och Project.
  • Öppna och skapa flera dokument i nya flikar i samma fönster, snarare än i nya fönster.
  • Ökar din produktivitet med 50 % och minskar hundratals musklick för dig varje dag!
Comments (14)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Prezados,
Bom dia!

É possível determinar algum parâmetro dentro do Range.

Quero fazer o PROCV trazer de um intervalo, porém ele acaba retornando valores de CEPs que não existem, mas que estão muito próximos...

Exemplo:

Na tabela existe a faixa de CEP 68795000 A 68796999 que é do estado do Pará
Ao utilizar as formula sugeridas, resulta como "verdadeiro" para a faixa de CEP 69301000 A 69390971 que é do estado de Roraima, devido a proximidade da numeração.
This comment was minimized by the moderator on the site
Hi Nilton Vanini,
I don't quite understand your question. Do you mind uploading a screenshot of your data? Sorry for the inconvenience.
This comment was minimized by the moderator on the site
This seems to also work with text. I got this to work with exact value rather than a range by using the "Value" column as part of the range in the formula.

My question is, are you forced to use 2 columns or is it possible to only use 1 and the value column?

I created a master sheet to call from but this is how I setup the formla

=VLOOKUP(I2,'Master Sheet'!$A$2:$B$53,2,TRUE)

Column "I" text (Number column in the example), I was forced to have a range so column "B" is both the Range and Value.

Is this best practice or would I run into unexpected issues down the road if more line items are added to this list?
This comment was minimized by the moderator on the site
Hi Andrew,
You may need to upload a screenshot of your data. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Bonjour je cherche à vérifier si une de mes valeurs correspond à une plage de données, le problème est que je n'ai pas qu'une valeur à vérifier mais une longue liste. J'aimerais que si une des 3 valeurs suivantes que je tape dans une case (exemple "panneau";"Strat";"chants") correspondent à une plage de données, elles 's'affichent en rouge par exemple. Sauriez vous me renseigner ? Merci.
This comment was minimized by the moderator on the site
Yo quiero devolver 1, si se encuentra en un rango de numeros determinados, ej. el rango es de 4 a 10, y en la celda tengo 5, devolver 1, pero si tengo 2 o 15, devolver 0.
This comment was minimized by the moderator on the site
Hi Daili,
If you just want to check if a number exists in a given range and return a specified value, you can combine IF with AND functions to get it done.
Suppose the number 4 is in cell A9, the number 10 is in cell B9, the number you want to determine if it exists between 4 and 10 is locateed in D9, you can apply the following formula to get the correct result.
=IF(AND(D9>A9,D9<B9),1,0)
This comment was minimized by the moderator on the site
Can you do a lookup searching a range of 3digit zips (i.e. 010-013 or 280-283,286,297) and pull in the city / state from your zip code list. The zip code list is all 3 digit zips in US broken out individually. The zips are listed multiple times because there are several city / state combinations. (i.e. 010 Ludlow MA; 010 Plamer MA etc).
This comment was minimized by the moderator on the site
The value works on the first cell. How do you do it for the entire column cell?
This comment was minimized by the moderator on the site
You will need to use $ for the lookup cells values
So if you have a column of values you want to look up you would modify the formula as follows:
=VLOOKUP(E2,$A$2:$C$8,3, TRUE)

E2 would change as you fill down but the table you are looking up from will remain constant
This comment was minimized by the moderator on the site
awesome, thanks!
This comment was minimized by the moderator on the site
Doesn't work. if only it was that simple, wouldn't need to be googling for this
This comment was minimized by the moderator on the site
It obviously does. Instead of whining and trying to be a smartass about it, you could have at least tried it out.
This comment was minimized by the moderator on the site
It does. Try it out before rudely complaining, simple as that.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations