+ Reply to Thread
Results 1 to 2 of 2

Loop function including If formula

  1. #1
    Registered User
    Join Date
    02-13-2015
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    1

    Loop function including If formula

    Hi Guys, I have values in column C. (All numerical) I have a formula that say if number is between 0-24 enter <25 in Column E. How do I do a loop so that it does this for all cells in column C that have data in them. This is my current formula.


    Sub Using_IF()

    Dim x As Integer

    x = ActiveSheet.Range("C2")

    If x <= 25 Then

    ActiveSheet.Range("E2").Value = "<25"

    ElseIf x <= 50 And x > 25 Then
    ActiveSheet.Range("E2").Value = "26-50"

    ElseIf x <= 99 And x > 50 Then
    ActiveSheet.Range("E2").Value = "51-99"

    ElseIf x <= 499 And x > 99 Then
    ActiveSheet.Range("E2").Value = "100-499"

    Else
    ActiveSheet.Range("E2").Value = "Over 500"

    End If

    End Sub

  2. #2
    Forum Contributor
    Join Date
    08-04-2014
    Location
    Riga
    MS-Off Ver
    2010
    Posts
    579

    Re: Loop function including If formula

    Something like this probably:

    Please Login or Register  to view this content.
    EndNumber value is 770, because I had 770 rows of numbers. Also I don't want to be picky, but this kind of thing is reffered to as a macro, not a formula if I'm not mistaken.
    Last edited by bmouse; 02-13-2015 at 07:01 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Do Until Loop including Vlookup
    By techteam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2012, 11:16 AM
  2. Replies: 9
    Last Post: 10-12-2010, 12:37 PM
  3. For next loop including two sets of arrays
    By stanysurfer in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-20-2010, 07:18 AM
  4. Including a search function in a match formula
    By Weasel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-16-2009, 03:57 AM
  5. [SOLVED] Including results of formula within concatenate function
    By trandle in forum Excel General
    Replies: 1
    Last Post: 09-23-2009, 05:39 PM

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