[Solved] Possible use of VLOOKUP
[Solved] Possible use of VLOOKUP
I am making an assumption which may not be correct, but I couldn't get it to work.
The task is this:
1.I have a master sheet with col. BOX, essentially numbers 1 to 10,000 filtered ascending, not necessarily a full set.
2. For each BOX no. there is a corresponding cell NAME which will be filled by incoming data which for convenience will be on another sheet.
3. On both sheets I want to limit the range over which to act.In practice the blue box will most likely be longer.
4. Then for every line in "box" run through the lines in "BOX" and if numbers agree, place "name in "NAME".
Any thoughts?
The task is this:
1.I have a master sheet with col. BOX, essentially numbers 1 to 10,000 filtered ascending, not necessarily a full set.
2. For each BOX no. there is a corresponding cell NAME which will be filled by incoming data which for convenience will be on another sheet.
3. On both sheets I want to limit the range over which to act.In practice the blue box will most likely be longer.
4. Then for every line in "box" run through the lines in "BOX" and if numbers agree, place "name in "NAME".
Any thoughts?
- Attachments
-
- Screenshot 2024-07-12 at 15.24.08.png (110.44 KiB) Viewed 4536 times
Last edited by Hagar Delest on Sat Jul 13, 2024 3:18 pm, edited 1 time in total.
Reason: tagged solved.
Reason: tagged solved.
ApacheOpenOffice 4.1.7
Mac OsX 14.6.1
Mac OsX 14.6.1
- MrProgrammer
- Moderator
- Posts: 5472
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Possible use of VLOOKUP
I don't see why you wouldn't be able to use VLOOKUP for that. This sounds exactly what VLOOKUP does when you use the technique in Q2/A2. The function can be used with ranges in different sheets.
[Tutorial] VLOOKUP questions and answers
No one can help with that until you explain in detail how the spreadsheet will know what the ranges for the blue and red boxes are. If you need any additional assistance attach a spreadsheet demonstrating the difficulty (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the spreadsheet itself). I will not help further unless you attach.
"It didn't work" isn't helpful in the forum because it tells us what did not happen. Please never use that phrase in a post. We need to know exactly what actions you took, what did happen, and what you expected to happen. For example, if you typed a formula, pressed Enter, and got #VALUE!, tell us that, not "It didn't work." Then attach your document so we can see what's wrong with that formula. Often "it didn't work" means "it didn't do what I expected" and the real problem is that the program is behaving correctly but your expectations are incorrect. To help you solve the problem we need to know your expectations and your ultimate goal.
If this solved your problem please go to your first post use the Edit ☐ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Possible use of VLOOKUP
Now that I know VLOOKUP is the correct entry point I will look up the help and examples.
Thanks for the quick response.
Thanks for the quick response.
ApacheOpenOffice 4.1.7
Mac OsX 14.6.1
Mac OsX 14.6.1
Re: Possible use of VLOOKUP
Note that VLooKUP() defaults to a kind of approximate matching and assumes that the key column is sorted. If there is no exact match, you will get the nearest lower value.
To force exact matching, you put zero in the fourth (optional) parameter to VLOOKUP(). No match will then return the #N/A error.
To force exact matching, you put zero in the fourth (optional) parameter to VLOOKUP(). No match will then return the #N/A error.
Re: Possible use of VLOOKUP
I've had partial success and wanted to show you a file but can't find a way to reduce 680 to 128 KB. Forgot how this is done!
ApacheOpenOffice 4.1.7
Mac OsX 14.6.1
Mac OsX 14.6.1
- MrProgrammer
- Moderator
- Posts: 5472
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Possible use of VLOOKUP
We don't need the entire file of 10000 rows, just enough to show what you're having difficulty with. A hundred rows is probably plenty. Close your spreadsheet. Open it again, use File → Save As → Name → VLOOKUP for Forum to make a copy, leaving the original untouched. Ensure that you are editing VLOOKUP for Forum. Delete the excess rows, save it, and attach that. You can also delete excess columns in the sheet or excess sheets which have no bearing on the problem. Ensure that the smaller file still demonstrates the difficulty. Explain which cell on which sheet of the reduced file contains a formula that doesn't do what you want. Explain in English what you want it to do.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Possible use of VLOOKUP
I know that there is still the issue with maintaining blank cells but the min thing is why did 'fred' H9 not transfer to the new list? The 'value to search for' and 'table to search in' will have a diffment number of lines.
ApacheOpenOffice 4.1.7
Mac OsX 14.6.1
Mac OsX 14.6.1
Re: Possible use of VLOOKUP
Hallo
You start with Formula:
BUT YOU SHOULD start with:
and for Libreoffice you may skip the #NA's with:
You start with Formula:
Code: Select all
=VLOOKUP( B10 ; $G4:$H9 ; 2 ;0 )Code: Select all
=VLOOKUP( B10 ; $G$4:$H$9 ; 2 ; 0 )Code: Select all
=IFNA(VLOOKUP( B10 ; $G$4:$H$9 ; 2 ; 0 ); "" )Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Re: Possible use of VLOOKUP
I don't understand, both of the last two codes give this:
- Attachments
-
- Screenshot 2024-07-13 at 08.29.43.png (74.97 KiB) Viewed 4409 times
ApacheOpenOffice 4.1.7
Mac OsX 14.6.1
Mac OsX 14.6.1
Re: Possible use of VLOOKUP
A sample spreadsheet would give some information; we can't tell anything from the picture as there is no information about what is in the formulae and where they are on the sheet.
Slackware 15 (current) 64 bit
Apache OpenOffice.1.16
LibreOffice 26.8.0.3; SlackBuild for 26.8.0 by Eric Hameleers
-----------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Apache OpenOffice.1.16
LibreOffice 26.8.0.3; SlackBuild for 26.8.0 by Eric Hameleers
-----------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Re: Possible use of VLOOKUP
I provided the file earlier in the thread, I thought I was replying to karolus who suggested a couple of solutions. Here it is again with the suggested code.
ApacheOpenOffice 4.1.7
Mac OsX 14.6.1
Mac OsX 14.6.1
Re: Possible use of VLOOKUP
Hallo
If you may read my last post carefully, you should see that »IFNA« is only for LIBREOFFICE but not for AOO!
If you may read my last post carefully, you should see that »IFNA« is only for LIBREOFFICE but not for AOO!
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Re: Possible use of VLOOKUP
Your original upload didn't show this error; and without you showing the changed formula, it would have been a wild guessing game to determine the problem.
Slackware 15 (current) 64 bit
Apache OpenOffice.1.16
LibreOffice 26.8.0.3; SlackBuild for 26.8.0 by Eric Hameleers
-----------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Apache OpenOffice.1.16
LibreOffice 26.8.0.3; SlackBuild for 26.8.0 by Eric Hameleers
-----------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Re: Possible use of VLOOKUP
I think I've got the solution now by going through the tutorials!
Copies as expected and blanks left blank instead of #N/A.
Copies as expected and blanks left blank instead of #N/A.
ApacheOpenOffice 4.1.7
Mac OsX 14.6.1
Mac OsX 14.6.1