Compare 2 cells provide a specific response

mhumphries

New Member
Joined
Nov 26, 2015
Messages
5
Hi all

I have a sheet that is gathering information from several other sheets using vlookup.
I have tried several functions, cannot get the right function to give a specific result

My question is

I need a specific response in column K
The response is created by determining what is in column i and column j

example

Column i = not_started column j = Complete_via_Payment_plan column k needs to give i5 (see row 8)

Column i = Complete_via_Payment_plan j = not_started column column k needs to give i3 (see row 25)

Wording can vary in column i and j, example completed or pending_payment etc.

Word other than not_started needs to give i3 or i5 response.

Your help appreciated

ExcelReturn.jpg
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Something like this?

Code:
Private Sub test()

Dim LastRowI As Long
Dim i As Long

LastRowI = Sheet1.Cells(Sheet1.Rows.Count, "I").End(xlUp).Row

For i = 1 To LastRowI

    If Sheet1.Range("I" & i).Text = "Not_Started" And Sheet1.Range("J" & i).Text = "Not_Started" Then
    
        Sheet1.Range("K" & i).Value2 = ""
        
    ElseIf Sheet1.Range("I" & i).Text <> "" And Sheet1.Range("J" & i).Text = "Not_Started" Then

        Sheet1.Range("K" & i).Value2 = "i3"
        
    ElseIf Sheet1.Range("I" & i).Text = "Not_Started" And Sheet1.Range("J" & i).Text <> "Not_Started" Then
    
        Sheet1.Range("K" & i).Value2 = "i5"

    End If
    
Next i

End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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