简体   繁体   English

微软 Excel 2003 | IF 语句

[英]Microsoft Excel 2003 | IF Statements

Firstly I'd like to say my knowledge on Excel is fairly limited, and I'm learning as I go, so feel free to input/correct on anything.首先,我想说我对 Excel 的了解相当有限,而且我正在学习 go,所以请随时输入/更正任何内容。

I have a set of information formated as follows:我有一组信息格式如下:

0.7 9.0 598287      
0.7 10.0 598288     
0.9 36.0 9186264        
4.5 298.0 4071637       
4.3 287.0 13896286      
0.9 18.0 4011248    

I need a to create a formula, that takes each peice of data, the first decimal number, the second, and the final string of numbers.我需要一个公式来创建一个公式,该公式包含每个数据、第一个十进制数、第二个和最后一串数字。 I've created a very long - and seemingly good statement, but it doesn't do exactly as I need.我创建了一个非常长且看似不错的声明,但它并不完全符合我的需要。 My Formula, and the outputs are as follows我的公式,输出如下

=IF(LEN(J194)=14,RIGHT(J194,6),IF(LEN(J194)=15,RIGHT(J194,6),IF(LEN(J194)=16,RIGHT(J194,6),IF(LEN(J194)=17,RIGHT(J194,7),IF(LEN(J194)=18,RIGHT(J194,8),RIGHT(J194,8))))))

   **DATA**             **OUTPUT**       **LENGTH**

0.7 9.0 598287          598287               14
0.7 10.0 598288         598288               15
0.9 36.0 9186264        186264               16
4.5 298.0 4071637       4071637              17
4.3 287.0 13896286      13896286             18
0.9 18.0 4011248        011248               16

The last column is the string length, as you can see - although the lengths of the strings are the same, I get a different output because the characters preceeding are shorter (1 digit,2 digit and 3 digit numbers)如您所见,最后一列是字符串长度-尽管字符串的长度相同,但我得到了不同的 output 因为前面的字符较短(1位,2位和3位数字)

What I need the formula to do, because my strings range from 14-18 characters in length, is to take the last digits no matter the overall cell length.我需要公式来做,因为我的字符串长度范围为 14-18 个字符,无论整个单元格长度如何,都取最后一个数字。 I am also adding an E to the front of each of these numbers via =CONCATENATE - so I cannot overcount.我还通过 =CONCATENATE 在每个数字的前面添加了一个 E - 所以我不能多算。

I'll gladly awnser any questions regarding my problem if clarifaction is needed.如果需要澄清,我很乐意回答有关我的问题的任何问题。

Thanks for taking the time to read over my post!感谢您花时间阅读我的帖子!

=RIGHT(J194,LEN(J194)-FIND(" ",J194,FIND(" ",J194)+1))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM