• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Check If Cell Begins with another cell|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Check If Cell Begins with another cell|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Check If Cell Begins with another c…
sp_PrintTopic sp_TopicIcon
Check If Cell Begins with another cell
Avatar
Marsil Sarvis
Member
Members
Level 0
Forum Posts: 73
Member Since:
September 6, 2019
sp_UserOfflineSmall Offline
1
April 28, 2020 - 2:13 am
sp_Permalink sp_Print

Hi,

Could you please help me to edit below function to let me know If Cell Begins with another cell or not. 

=IF(LEFT(TRIM(A2),1)="s","OK","Not OK") 

My target is check if Numbers in A2 start with C2 values.

Phone Status Key
8475755 No 87
435566 Yes 4
436576 Yes 4365
Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
2
April 28, 2020 - 5:07 am
sp_Permalink sp_Print

Its always better to upload an example workbook so we know how the data is setup

Are you after something like this?

=IF(TRIM(LEFT(A2,LEN(C2)))+0=C2,"Ok","not Ok")

Purfleet

Avatar
Marsil Sarvis
Member
Members
Level 0
Forum Posts: 73
Member Since:
September 6, 2019
sp_UserOfflineSmall Offline
3
April 28, 2020 - 7:54 am
sp_Permalink sp_Print

Hi Purfleet,

It works perfectly, Thank you very much!

Is this other function for characters? please check attached file.
 

Grateful for your support..

Thanks;

Marsil

Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
4
April 29, 2020 - 2:01 am
sp_Permalink sp_Print

Hi Marsil

Nothing attached, but to break it down (I am sure you know most of it)

=IF(TRIM(LEFT(A2,LEN(C2)))+0=C2,"Ok","not Ok")

Len(C2) gets the number of characters to check

Left(a2) gets the left characters for the number of the above Len

Trim makes sure there is no random spaces

and if makes the determination

the +0 makes the text from the trim/left/len into a number

Hope that helps

Avatar
Marsil Sarvis
Member
Members
Level 0
Forum Posts: 73
Member Since:
September 6, 2019
sp_UserOfflineSmall Offline
5
April 30, 2020 - 10:34 pm
sp_Permalink sp_Print

Hi Purfleet,

Thank you very much; your support is greatly appreciated.

Please check attached file and try to handle the function please.

Thanks;

Marsil

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 688
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
6
May 1, 2020 - 12:08 am
sp_Permalink sp_Print

Just remove the +0 from the formula, since your values are not numeric. If you need to handle both numbers and text in the same formula, you could use:

 

=IF(TRIM(LEFT(A2,LEN(C2)))=""&C2,"Yes","No")

The following users say thank you to Velouria for this useful post:

Purfleet
sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Nesha St, Syed Hussain, Jason Fitzpatrick
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
jaryszek: 183
Newest Members:
Ashley Hughes
Herbie Key
Trevor Pindling
Stevan Kanjo
Erin Sheldon
Nikita Bhatia
Sheilah Taylor
Clare Webber
David Jenssen
Dominic Brosnahan
Forum Stats:
Groups: 3
Forums: 24
Topics: 6526
Posts: 28577

 

Member Stats:
Guest Posters: 49
Members: 32810
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.