We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide
Excel Code Translation
The_Hurricane
Posts: 773 Forumite
Hi All,
I'm having trouble understand what the following piece of code does on an Excel page I am using could anyone advise?
=IF(F2="Football",IF(LEFT(C2,2)="SP","Football",IF(LEFT(C2,1)="W","Motorsport",IF(LEFT(C2,1)="S","Motorsport",F2))),F2)
Thanks in advance.
I'm having trouble understand what the following piece of code does on an Excel page I am using could anyone advise?
=IF(F2="Football",IF(LEFT(C2,2)="SP","Football",IF(LEFT(C2,1)="W","Motorsport",IF(LEFT(C2,1)="S","Motorsport",F2))),F2)
Thanks in advance.
0
Comments
-
When parsing an if/else tree it's handy to indent them:
If cell F2 is the text "Football" Then If the first two letters of cell C2 are "SP" Then the result is "Football" Else If the first letter of cell C2 is "W" Then the result is "Motorsport" Else If the first letter of C2 is "S" Then the result is "Mo torsport" Else the result is the same as F2 (which we know is Football thanks to the very first If statement) Else the result is the same as F2
So it's selecting results based on F2 and (the first one or two letters of) C2.
Thanks
Mirno0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 353.4K Banking & Borrowing
- 254.1K Reduce Debt & Boost Income
- 455K Spending & Discounts
- 246.5K Work, Benefits & Business
- 602.8K Mortgages, Homes & Bills
- 178K Life & Family
- 260.5K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 37.7K Read-Only Boards