Formula to populate either "Up" or "Down" based on location of entry in Column A

y3tter

Board Regular
Joined
Nov 11, 2012
Messages
147
I have three columns. Only one cell in column A will have a value, which will be "Active". Column B is locations. In column C I'm trying to get anything that at or below the "Active" indicator to populate as "Down" and anything above the "Active" marker to populate as "Up".

MinnUp
LarsUp
ActiveX5Down
Lars_1Down
Y2Down
Z6Down

<tbody>
</tbody>
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Assuming data starts in row 1, try:
Code:
Sub y3etter()
    Application.ScreenUpdating = False
    Dim LastRow As Long, fnd As Long
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    fnd = Range("A:A").Find("Active").Row
    Range("C1:C" & fnd - 1) = "Up"
    Range("C" & fnd & ":C" & LastRow) = "Down"
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Hey,

try this formula in C1 and drag it down:

=IF(COUNTIF($A$1:A1,"Active")=1,"Down","Up")
 
Upvote 0
Assuming data starts in row 1, try:
Code:
Sub y3etter()
    Application.ScreenUpdating = False
    Dim LastRow As Long, fnd As Long
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    fnd = Range("A:A").Find("Active").Row
    Range("C1:C" & fnd - 1) = "Up"
    Range("C" & fnd & ":C" & LastRow) = "Down"
    Application.ScreenUpdating = True
End Sub


Thank you!!
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,938
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top