+ Reply to Thread
Results 1 to 16 of 16

Formula To Link If Less Than, Display Otherwise If Greater Than

  1. #1
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Question Formula To Link If Less Than, Display Otherwise If Greater Than

    Would a formula in Cell B1 be able to do this, or would I need code?

    Display value of Cell A1 if value in Cell A1 = 20 or less characters; if more than 20 characters, then display 'SEE CELL C1' and display Cell A1 value in Cell C1.

    I could do this with a formula in Cell B1 and a formula in Cell C1, but Cell C1 must not contain a formula.

    Any thoughts?
    There is so much good in the worst of us,
    And so much bad in the best of us,
    That it hardly behooves any of us
    To talk about the rest of us.

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Hello

    Place this formula in B1:
    =IF(LEN(A1)<=20,A1,"See Cell C1")
    Place this formula in C1:
    =IF(B1="See Cell C1",A1,"")

    Regards..
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Thank you jraj1106, I realize that is an easier option, but Cell C1 must not contain a formula. Is there a way to combine those two formulas into one formula that would go into Cell B1?

  4. #4
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Does anyone know how I could do this? I'd really appreciate it.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    If not formula, VBA might be able to help you. Let me work this out.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Right click on the sheet that has the data in it, select "View Code". Then copy this code over.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Thank you so much, arlu1201!

    That looks like it will work beautifully, however, this is current code of the sheet I'm using:

    Please Login or Register  to view this content.
    What's the right way of 'merging' two Worksheet_Change codes?

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Quote Originally Posted by arlu1201 View Post
    Right click on the sheet that has the data in it, select "View Code". Then copy this code over.
    Please Login or Register  to view this content.
    just fyi neither of those exit subs are needed and they may cause problems when you come to merge that into the existing change event.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Thanks Joseph.

    I put the Exit subs because the subs were taking long to execute.

    And i agree with you that they need to be removed while merging the codes.

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Quote Originally Posted by arlu1201 View Post
    I put the Exit subs because the subs were taking long to execute.
    but they don't do anything.

  11. #11
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    So where would I insert that?

  12. #12
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Does anybody know? I'm stuck.

  13. #13
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Anyone at all?

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Please do not bump your thread so often. It will irritate others.
    So where would I insert that?
    What are you talking about?

  15. #15
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    Thank you for your reply, arlu1201. I have no intentions of irritating anyone, I suppose I'm getting somewhat desperate for a solution which I needed about a week ago. My apologies.

    I'm simply asking how to merge this code:

    Please Login or Register  to view this content.
    ..with this one:

    Please Login or Register  to view this content.
    ..since my attempts have all failed - I don't the right way of doing so.

  16. #16
    Forum Contributor swordswinger710's Avatar
    Join Date
    02-20-2008
    Location
    Bright, Canada
    MS-Off Ver
    2010
    Posts
    845

    Re: Formula To Link If Less Than, Display Otherwise If Greater Than

    I'll mark this as solved and ask about merging in a new thread. Thank you for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1