1

I have a column called "name", I wanna to create a new column to be group. if the file name contains "MDSN", will return "MDSN" file, if not, will reutrn "non-MDSN"

I found a way starts-with(@FileLeafRef,"MDKB"), but I also wanna control the return values, how can I do?

A touph questions for me but can anyone help me out?

bowang
  • 355
  • 3
  • 6
  • 14
  • Are you looking for flagging when something STARTS with "MSDN" or CONTAINS? Your question mentions both. – Ryan Aug 11 '12 at 14:39

2 Answers2

1

Assuming you mean you're looking to show when a string starts with another string then this will work

=IF(LEFT([Name],4)="MSDN","MSDN",non-MSDN")
Ryan
  • 23,871
  • 24
  • 86
  • 132
  • thank you! but I tried and it didn't work, is that code runing in ASP.NET? – bowang Aug 13 '12 at 14:17
  • 1
    Its intended to go in as the formula in a CALCULATED COLUMN - which is what I though you wanted from your Q as did Rahil. Put a bit more effort into making good questions and you will be rewarded with good answers. – Ryan Aug 17 '12 at 10:19
0

For Starts with: =IF(LEFT([Name],4)="MSDN","MSDN",non-MSDN")

For Contains: =IF(ISNUMBER(FIND("MSDN",[Name])), "MSDN", "non-MSDN")

For More help on Formula: http://msdn.microsoft.com/en-us/library/bb862071.aspx

Raheel
  • 595
  • 8
  • 21