ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Returning the value (https://www.excelbanter.com/excel-discussion-misc-queries/233753-returning-value.html)

Returning the value

Returning the value
 
"I am having a table containing sum values i.e,
1)1325521
2)121541
3)212181
4)121
If I search for value 216703
Then it should return me the value 4522 + 212181 =216703

kindly let me know the solution for the same.

"


Jacob Skaria

Returning the value
 
Try this

In Col A put all your values..Sort in ascending order.
In B1 enter search value 216703
In C1

=IF(ISNA(VLOOKUP(B1,A2:A10,1,TRUE)),0,B1-VLOOKUP(B1,A2:A10,1,TRUE)) & " + "
& VLOOKUP(B1,A2:A10,1,TRUE) & " = " & B1


This will return error if you enter a value which is less than the smallest
value in ColA. This can be handled easily....but the logic still remains the
same....Adjust to suit...Try and feedback

If this post helps click Yes
---------------
Jacob Skaria


"Returning the value" wrote:

"I am having a table containing sum values i.e,
1)1325521
2)121541
3)212181
4)121
If I search for value 216703
Then it should return me the value 4522 + 212181 =216703

kindly let me know the solution for the same.

"


Jacob Skaria

Returning the value
 
'Revised one.try with a unsorted list..

=IF(ISNA(VLOOKUP(B1,A1:A10,1,TRUE)),0,B1-VLOOKUP(B1,A1:A10,1,TRUE) & " + " &
VLOOKUP(B1,A1:A10,1,TRUE) & " = " & B1)

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Try this

In Col A put all your values..Sort in ascending order.
In B1 enter search value 216703
In C1

=IF(ISNA(VLOOKUP(B1,A2:A10,1,TRUE)),0,B1-VLOOKUP(B1,A2:A10,1,TRUE)) & " + "
& VLOOKUP(B1,A2:A10,1,TRUE) & " = " & B1


This will return error if you enter a value which is less than the smallest
value in ColA. This can be handled easily....but the logic still remains the
same....Adjust to suit...Try and feedback

If this post helps click Yes
---------------
Jacob Skaria


"Returning the value" wrote:

"I am having a table containing sum values i.e,
1)1325521
2)121541
3)212181
4)121
If I search for value 216703
Then it should return me the value 4522 + 212181 =216703

kindly let me know the solution for the same.

"



All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com