EXCEL 中find,if and,if or

接上一篇sql中find函数的作用,由于工作需求是用帆软做报表,他的一些代码不仅有js,sql中的还有一些excel的相关知识,故作整理。

FIND()

excel中的find原理和sql中相似,具体可查看

SQL函数 $FIND_Yangshiwei....的博客-CSDN博客

但他返回的是该字符子串,在原字符串的开始位置,即匹配上的第一个字符位置

若匹配不上,则值为#VALUE!

IF AND |IF OR

在if函数中,and表示交集关系,也就是说所列入的条件必须全部满足,才能返回满足and条件的值,or表示并集关系,也就是“或”的关系,所列入的条件只需要满足其中之一即可。

and

在下图中,我们规定所有科目>85分才为优

输入所有逻辑后,得到的结果是

可以发现,满足条件的会得到我们规定的值——”优”,不满足条件者为空

or

假设给定一个字符转asdiuaehdfkjf,我们从中只要发现含有字母u或字母A,就输出0

我们会发现他报错了,但我们明明字符串中有“u”这个字母

这是因为我们里面找不到字母“A”(区分大小写),所以后面的出错报错影响了整体的判断,如果我们不想这样我们就应该使用IFERROR函数,IFERROR函数表示判断某些内容的正确与否,正确则返回正确结果,错误则返回需要显示的信息。

当然IFERROR函数可以根据我们的需求展示我们想展示的错误信息

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
You have just been promoted into a job that requires more Excel skills than ever. You are floundering, drowning in a sea of spreadsheets. This book walks you through in an easy accessible way—vlookups, pivot tables, Power Query, and Power Pivot. The Excel Survival Kit is small enough to slip into your purse. Chapter 1, “Back to Basics: What Do You Know Already?”: This chapter provides a quick intro to the absolute essentials you need to know to grapple with Excel. It shows you how to tackle common tasks like printing, sorting and filtering, and fixing cells. It is set up as a series of numbered steps that you can quickly work through to learn or get reacquainted with Excel basics. Note This book comes with files you can practice on. Find these files at www.mrexcel.com/survivalfiles.html. Chapter 2, “Getting Your Data Together: Catching Your File”: This chapter is about getting your data together and, more importantly, assembling your data in a way that makes doing all the other clever stuff with Excel relatively straightforward. This is the secret sauce. This chapter shows you how to set up a list so that your data is entered accurately and completely. It shows you how to set up your data so that you can easily get whatever you need out of it later on. It shows you how to set up a simple list and how to create a list for your recurring data. It’s the piece that’s often omitted in many Excel books. You get it here. Chapter 3, “Further Cleaning, Slicing, and Dicing”: Yes, at this point you’ve already got your data into good shape, but you may still need to do further clean-up. This chapter shows you how to remove/complete blank rows, columns, and cells. You will learn some clever quick techniques to clean, combine, and amend existing data. You will also see examples of using formulas to extract specific pieces of data from a data set. You will learn how to identify and remove duplicates and to use conditional formatting to quickly identify the appropriate entries. Chapter 4, “The Vlookup() Function: An Excel Essential”: One of the key tasks in Excel is pulling in and assembling matching data from different sources. To do this, you need to know Excel’s Vlookup() function. This entire chapter focuses on this function, including how to use it and also its pitfalls and idiosyncrasies so that you know how to handle this function with speed and care. You will learn how to use it to compare lists and identify missing data (in minutes rather than hours). Chapter 5, “Creating Pivot Tables”: When you need to summarize and present all the data you have so lovingly gathered, cleaned, and assembled, you need to use a pivot table. You can use a pivot table to summarize thousands of rows of data in minutes. A learner once described it to me beautifully as “shrinking your data,” and that’s what a pivot table allows you to do. You can quickly and easily view your data by months or by various headings. If your boss wants to get a different view of some data and if you have a pivot table, you can deliver the goods in minutes. Moving from manual data organization using filters and sorting to using pivot tables is like moving from walking to driving. Chapter 6, “Using Power Query to Quickly Clean Up Data”: Before this point in the book, you have done a lot of data clean-up manually. In this chapter you learn how to use Power Query to do that work in minutes and, even more amazingly, how to store the steps you take so that all you have to do when you get next month’s data is change the data source. Power Query is a game changer, but it’s still not very well known beyond the Excel world, so if you learn to use it, you have the inside track. I have to say that every time I use Power Query to clean up data, I feel like a magician—and I want you to feel like that, too. Chapter 7, “Beyond the Pivot Table: Power Pivot”: If using pivot tables is like driving a car, using Power Pivot is like travelling by jet. Power Pivot allows you to assemble lots of different data sets together without using Vlookup()s and to generate pivot tables with formulas (measures) that allow you to look at your data in all sorts of new ways. Power Pivot is the future of pivot tables, and you’ll get a taste of it here
EXCEL 函数速查手册   一、数学和三角函数(60条) ·ABS ·ACOS ·ACOSH ·ASIN ·ASINH ·ATAN ·ATAN2 ·ATANH ·CEILING ·COMBIN ·COS ·COSH ·COUNTIF ·DEGREES ·EVEN ·EXP ·FACT ·FACTDOUBLE ·FLOOR ·GCD ·INT ·LCM ·LN ·LOG ·LOG10 ·MDETERM ·MINVERSE ·MMULT ·MOD ·MROUND ·MULTINOMIAL ·ODD ·PI ·POWER ·PRODUCT ·QUOTIENT ·RADIANS ·RAND ·RANDBETWEEN ·ROMAN ·ROUND ·ROUNDDOWN ·ROUNDUP ·SERIESSUM ·SIGN ·SIN ·SINH ·SQRT ·SQRTPI ·SUBTOTAL ·SUM ·SUMIF ·SUMPRODUCT ·SUMSQ ·SUMX2MY2 ·SUMX2PY2 ·SUMXMY2 ·TAN ·TANH ·TRUNC 二、统计函数(80条) ·AVEDEV ·AVERAGE ·AVERAGEA ·BETADIST ·BETAINV ·BINOMDIST ·CHIDIST ·CHIINV ·CHITEST ·CONFIDENCE ·CORREL ·COUNT ·COUNTA ·COUNTBLANK ·COUNTIF ·COVAR ·CRITBINOM ·DEVSQ ·EXPONDIST ·FDIST ·FINV ·FISHER ·FISHERINV ·FORECAST ·FREQUENCY ·FTEST ·GAMMADIST ·GAMMAINV ·GAMMALN ·GEOMEAN ·GROWTH ·HARMEAN ·HYPGEOMDIST ·INTERCEPT ·KURT ·LARGE ·LINEST ·LOGEST ·LOGINV ·LOGNORMDIST ·MAX ·MAXA ·MEDIAN ·MIN ·MINA ·MODE ·NEGBINOMDIST ·NORMDIST ·NORMSINV ·NORMSDIST ·NORMSINV ·PEARSON ·PERCENTILE ·PERCENTRANK ·PERMUT ·POISSON ·PROB ·QUARTILE ·RANK ·RSQ ·SKEW ·SLOPE ·SMALL ·STANDARDIZE ·STDEV ·STDEVA ·STDEVP ·STDEVPA ·STEYX ·TDIST ·TINV ·TREND ·TRIMMEAN ·TTEST ·VAR ·VARA ·VARP ·VARPA ·WEIBULL ·ZTEST 三、文本和数据函数(28条) ·ASC ·CHAR ·CLEAN ·CODE ·CONCATENATE ·DOLLAR 或 RMB ·EXACT ·FIND ·FINDB ·FIXED ·JIS ·LEFT 或 LEFTB ·LEN 或 LENB ·LOWER ·MID 或 MIDB ·PHONETIC ·PROPER ·REPLACE 或 REPL ·REPT ·RIGHT 或 RIGHTB ·SEARCH 或 SEARC ·SUBSTITUTE ·T ·TEXT ·TRIM ·UPPER ·value ·WIDECHAR 四、逻辑运算符(6条) ·AND ·FALSE ·IF ·NOT ·OR ·TRUE 五、查找和引用函数(17条) ·ADDRESS ·AREAS ·CHOOSE ·COLUMN ·COLUMNS ·HLOOKUP ·HYPERLINK ·INDEX ·INDIRECT ·LOOKUP ·MATCH ·OFFSET ·ROW ·ROWS ·RTD ·TRANSPOSE ·VLOOKUP 六、数据库函数(13条) ·DAVERAGE ·DCOUNT ·DCOUNTA ·DGET ·DMAX ·DMIN ·DPRODUCT ·DSTDEV ·DSTDEVP ·DSUM
Excel 文转换成拼音首字母,需要用到 Excel 的 CONCATENATE 函数和 VBA 的函数。具体步骤如下: 1. 打开 Excel 文档,选需要转换的文文字所在的单元格。 2. 在单元格输入以下公式: =CONCATENATE(IF(ISERROR(FIND(LEFT(B1,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")), LEFT(B1,1), ""), IF(ISERROR(FIND(MID(B1,2,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")), MID(B1,2,1), ""), IF(ISERROR(FIND(MID(B1,3,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")), MID(B1,3,1), ""), IF(ISERROR(FIND(MID(B1,4,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")), MID(B1,4,1), "")) 其,B1 表示需要转换的文文字所在的单元格。 3. 按下 Enter 键,完成公式输入。此时,该单元格文文字已经转换成了拼音首字母。 4. 如果需要批量转换多个文文字,可以将公式拖动到需要转换的单元格范围内,再按下 Ctrl+Enter 键,即可完成批量转换。 5. 如果需要将上述公式导入到 VBA ,可以使用以下 VBA 函数: Function ChineseToPinyin(ByVal str As String) As String Dim i As Integer For i = 1 To Len(str) If AscW(Mid(str, i, 1)) < 19968 Or AscW(Mid(str, i, 1)) > 40869 Then ChineseToPinyin = ChineseToPinyin & Mid(str, i, 1) Else ChineseToPinyin = ChineseToPinyin & Left(Application.WorksheetFunction.VLookup(Mid(str, i, 1), Range("A1:B405"), 2, False), 1) End If Next i End Function 其,Range("A1:B405") 是一个包含文字符和对应拼音首字母的数据表格。在使用该函数时,需要将该数据表格插入到 Excel ,并修改代码的数据表格范围和单元格引用。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值