Multiple If conditions, vlookup?....

tex-i-can

New Member
Joined
Jul 2, 2013
Messages
1
Hello all,

I am wokrking a 100k line spreadsheet and need some help. I am trying to display the value in column D from sheet 1 of my file to sheet 2. The catch is I need columns A, B and C to meet certain critera.


Col. A Col. B Col. C Col.D
Blue Circle Table 1000

Green Square Chair 2000

Yellow Cirlce Desk 3000

Red Square Chair 4000


What I am looking to do is display the value in column D if column A is "Green", Column B is "Square" and Column C is "Chair". I want "2000" (cell D2) to display as the answer. I dont want to have to tell it to display D2. In other words, if possible, I would like to have excel find this cell and display it. All combinations in the first 3 columns are unique to each row, meaing I wont have to worry about two rows having the same combination. If this does not make sense please let me know. Thanks
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try:
Code:
Sub Test()
    Application.ScreenUpdating = False
    Dim criteria1 As String
    Dim criteria2 As String
    Dim criteria3 As String
    criteria1 = InputBox("Please enter the color.")
    criteria2 = InputBox("Please enter the shape.")
    criteria3 = InputBox("Please enter the item.")
    Dim bottomA As Integer
    bottomA = Range("A" & Rows.Count).End(xlUp).Row
    Dim x As Long
    For x = bottomA To 2 Step -1
        If Cells(x, "A") = criteria1 And Cells(x, "B") = criteria2 And Cells(x, "C") = criteria3 Then
            MsgBox Cells(x, "D")
        End If
    Next x
    Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0
try: SUMPRODUCT(--(A1:A1000="Green"),--(B1:b1000="square",--(C1:C1000="Chair"),D1:D1000) adjust ranges
 
Upvote 0

Forum statistics

Threads
1,215,364
Messages
6,124,510
Members
449,166
Latest member
hokjock

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