I have some rows with numbers and strings, how can I find first non-zero value in each row?
Example:
0 2 0 0 0 ----> 2
0 0 1 0 2 ----> 1
0 0 ENG 2 0 ----> ENG
Thanks in advance.
I have some rows with numbers and strings, how can I find first non-zero value in each row?
Example:
0 2 0 0 0 ----> 2
0 0 1 0 2 ----> 1
0 0 ENG 2 0 ----> ENG
Thanks in advance.
Last edited by omid020; 01-12-2024 at 03:28 AM.
Try:
=LOOKUP(2,1/(A1:ZZ1<>0),A1:ZZ1)
Adjust the range to suit, and copy down.
Administrative Note:
Is your forum profile showing the Excel PRODUCT that you need this to work for?
Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.
The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.
Thanks.
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
Ali,
doesnt that find the LAST non zero value in a row?
Regards
Special-K
Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.
Yes - I misread the question!
Waiting to see what version of Excel the OP has.
Please try (works in Excel 2007 and newer):Formula:Please Login or Register to view this content.
If you don't have Excel 365, please confirm the formula with Ctrl+Shift+Enter
Sorry for delay. both suggested functions work like a charm in excel 2010. Thanks!
Mine doesn't!
If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.
Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks