Lookup a value in a list
3 posts
• Page 1 of 1
- 1q2w3e4rr
- Junior Member
- Posts: 8
- Joined: Wed Dec 21, 2016 8:29 pm
- Calculators: Casio Classpad fx-CP400
Lookup a value in a list
hi
i have made some list and my list has several rows and columns. i want to search in this list for a special value. and get the row number of where it sit in the list.
for example i input x
and i want to find x in the list1's first column, and find out which row it sit!
like lookup function in excel.
thank for helping me
i have made some list and my list has several rows and columns. i want to search in this list for a special value. and get the row number of where it sit in the list.
for example i input x
and i want to find x in the list1's first column, and find out which row it sit!
like lookup function in excel.
thank for helping me
Re: Lookup a value in a list
A simple for loop would be enough, I think.
- Code: Select all
For 1->I To 999 //change to 255 if you have an older OS/calc
List 1[I]=X => Break
Next
//I is the row where the variable is
- 1q2w3e4rr
- Junior Member
- Posts: 8
- Joined: Wed Dec 21, 2016 8:29 pm
- Calculators: Casio Classpad fx-CP400
Re: Lookup a value in a list
thank u
the cod i used:
the cod i used:
- Code: Select all
input j
[[21.3×2,1.21,0.962,0.571,0.536,0.686],[21.3×2.6,1.53,1.21,0.681,0.639,0.668],[21.3×3.2,1.82,1.44,0.768,0.722,0.65]]⇒IP
for 1=>i to rowdim(IP) ' represent the last row number '
if IP[i,1]=I :then
print IP[i,3]
print IP[i,4]
ifend
next
3 posts
• Page 1 of 1
Return to Casio Basic Development
Who is online
Users browsing this forum: No registered users and 1 guest