IF(logical_test,value_if_true,look_for_next_cell)

veagnox

New Member
Joined
Jan 27, 2018
Messages
2
Hi everyone. It might be simple question for someone. Here's the first 5 rows of table:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]11[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]14[/TD]
[TD]15[/TD]
[/TR]
</tbody>[/TABLE]

Let's say that I want to use IF formula: value_if_true will be "success" if logical_test will meet condition A1=7 and B1=8 and C1=9, but if it's not true, I want excel to look up for next cell
I know all the way to use multiple conditions, and I know the way to check A2 B2 C2 if A1 B1 C1 not meet condition. But I want it to go to NEXT row, not just from A to B, as I have hundreds of rows (I just want to say that I can't write formula for each row A1 A2 A3 and etc.)

Hope you guys will understand my problem and help me to solve it
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You can write the formula in the first cell and then select the 'square' at the bottom right of the cell and drag down.
 
Upvote 0
Thanks for reply. I woke up just 5 minutes ago before posting it, so I wrote something wrong (sorry for that). I couldn't edit post so I'm writing explanation here (corrections will be red)

Let's say that I want to use IF formula: value_if_true will be "success" if logical_test will meet condition A1=7 and B1=8 and C1=9, but if it's not true, I want excel to look up for next ROW
I know all the way to use multiple conditions, and I know the way to check A2 B2 C2 if A1 B1 C1 not meet condition. But I want it to go to NEXT row, not just from row 1 to row 2, but from row x to row x+1 as I have hundreds of rows (I just want to say that I can't write formula for each row A1 A2 A3 and etc.)

 
Upvote 0
Code:
Sub Lckup()
 
 Dim R As Range
 
 
 For Each R In ActiveSheet.Range(Cells(1, 1), Cells(Columns.Count, 1))
 
 If R.Value = 7 And Cells(R.Row, 2).Value = 8 And Cells(R.Row, 3).Value = 9 Then
 
 R.Resize(1, 3).Select
 MsgBox "Row# " & R.Row
Exit For
End If
 
 Next
 
 






End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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