[Solved] Unexpected result from VLOOKUP

Discuss the spreadsheet application
Post Reply
Binu
Posts: 13
Joined: Tue Nov 08, 2022 4:52 pm

[Solved] Unexpected result from VLOOKUP

Post by Binu »

Hi,
I was trying to print an output in "Column C" which is the value in "Column B" that corresponds to the maximum value in "Column A".
Column A is having a same values and blank column also. I was supposed to get the first occurred maximum value and its corresponding value in next column but I got the second occurred maximum. Tried everything that I can, but the result was same. It is giving only the right output only when all the cells in the Column A is having values.
Someone Please help me out in this.

Please find the attached file for reference.

Thanks & Regards,
Binu Varghese
Attachments
test.ods
(10.09 KiB) Downloaded 60 times
Last edited by Binu on Sun May 19, 2024 6:36 pm, edited 1 time in total.
Open office 4.0 + Ubuntu 18.04
User avatar
MrProgrammer
Moderator
Posts: 5431
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Printing value corresponds to another value in a column

Post by MrProgrammer »

Binu wrote: Sun May 19, 2024 4:16 pm Column A is having a same values and blank column also.
If you make column A wider you will see that the values of the cells which appear to be 1100 are not the same.
Study [Tutorial] VLOOKUP questions and answers; Q16/A16 explains why VLOOKUP returned 09:00.

202409190927.gif
202409190927.gif (31.93 KiB) Viewed 1935 times

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).
Binu
Posts: 13
Joined: Tue Nov 08, 2022 4:52 pm

Re: Printing value corresponds to another value in a column

Post by Binu »

Hi,
Thank You for the reply,
Sorry for the error in the attached file, Actually in my case all the values are same, but the thing is that, these values are the output of a formula given in another sheet A, as attached in the new attachment. I am trying to get the max and corresponding value in another sheet and there it is not giving the correct output.
Attachments
test2.ods
(12.35 KiB) Downloaded 84 times
Open office 4.0 + Ubuntu 18.04
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: Printing value corresponds to another value in a column

Post by Alex1 »

Widening column C shows:

1000
--
1099.9999999986
1100.0000000022
1099.9999999986

Non-integer decimal values generally cannot be represented exactly in binary. Use one of the rounding functions, e.g.
=IF(A2=B2;"--";ROUND((A2-B2)*1000;0)) in C2.
AOO 4.1.16 & LO 25.8.3 on Windows 10
Binu
Posts: 13
Joined: Tue Nov 08, 2022 4:52 pm

Re: Printing value corresponds to another value in a column

Post by Binu »

Hi Alex1 ,

Rounding off helped and it works. Thanks a lot!
Open office 4.0 + Ubuntu 18.04
Post Reply