Search : in
By :

Substitute conditional IF function

Last answer on Sep 13, 2009 4:00:52 pm BST David, on Sep 12, 2009 3:18:59 pm BST 
 Report this message to moderators

Hello,
I used conditional IF to write my formulas but when my table increase in size, it became many IF statements in a cell.
I tried to replace IF with lookup function but some how I got so many ERR.
Can someone write me the formulas to solve my issue?

Here is the example:
It can be a row or column but let assume it is a row A1, B1, C1, etc.
Ie. A1 = -25, B1 = 0, and C1 = 31.

We have another row consist of A7 to AA7 for example.

Now we want to search through A7 to AA7 to find a value between A1 and B1(between -25 to 0), B1 and C1 (between 0 to 31) etc...
If it does found, it will display the found value in a cell in question.

Thanks.

Configuration: Windows XP
Firefox 3.0.5

Best answers for « Substitute conditional IF function » in :
[Excel 2003] - IF Function using Dates & Text Show [Excel 2003] - IF Function using Dates & Text Issue Solution Note Issue I'm trying to write a function for a cell which refers to a date in another cell - which if it is between 01/01/1994 and 31/12/1995 the cell will read U16, but...
Basic Excel Formulas ShowBasic Excel Formulas Below are some basic formulas for Microsoft excel: Basic formula : ADDITION cell A1 to A10 = sum (A1: A10) AVERAGE cell A1 to A10 = average (A1: A10) MAXIMUM cell A1 to A10 = max (A1: A10) MINIMUM...
Colouring cells on conditions ShowColouring cells on conditions There are many pratical functions under Excel which is not commonly used. Example: If you wish a cell automatically turns red (or other formatting border, frame etc) under one condition: a result, a...
Basic Excel Formulas 2 ShowBasic Excel Formulas 2 We saw the SI function Function and is also interesting. Combined with SI, this gives: = IF (AND (condition1; condition2 ;....... conditionZ) true false) displays on the various conditions to be verified (eg...
Spreadsheets - Conditional expressions ShowWhat is a Conditional Structure? Conditional structures are instructions that allow to test if a condition is true or not. Conditional structures may be associated together. To successfully execute these tests using logical functions, spreadsheets...
Substitution cipher ShowSubstitution cipher Substitution cipher involves replacing one or more entities (generally letters) in a message with one or more other entities. There are several types of substitution cryptosystems: Monoalphabetic substitution involves...
Spreadsheets - Mathematical Functions ShowStandard Functions Function Description ABS() This function returns the absolute value of a number. It therefore returns the number, if it is positive, or the opposite (positive) if it is negative ODD(value) Rounds a number up to the...

1

venkat1926, on Sep 13, 2009 1:58:11 am BST

You did not give complete informational. If a cell in range A1:AA77 is between A1 and B1 what should I do
quote
If it does found, it will display the found value in a cell in question.
unquote
what is meant by "display" and "cell in question"

tell me this
1.suppose F7 is found to be between a1 and B1 what should I do???????
2. suppose more than one cell in A7:AA7 which are between a1 and b1 what should I do with all these cells


the macro I have given below will find the cell in A7:AA7 and give its address.

It will continue to loop with all the cells in A1:AA7 and
then loop next
again start finding out whether any cell in A7:AA7 is betwen B1 and C1 and so on till all the cells are exhausted
You modify the macro to suit ou.

Sub test()
Dim rng As Range, c As Range, rng1 As Range, c1 As Range
Dim x1, x2
With Worksheets("sheet1")
Set rng = Range(.Range("a1"), .Range("a1").End(xlToRight)).Offset(0, -1)
For Each c In rng
x1 = c.Value
x2 = c.Offset(0, 1).Value
x1 = WorksheetFunction.Min(x1, x2)
x2 = WorksheetFunction.Max(x1, x2)
Set rng1 = .Range("a7:aa7")
For Each c1 In rng1
If c1 >= x1 And c1 <= x2 Then
MsgBox c1.Address
End If
Next c1
Next c
End With
End Sub 

Reply to venkat1926

2

 David Scott, on Sep 13, 2009 4:00:52 pm BST

Sorry for failing short of expanding the detail.
1 If it does found, it will display the found value in a cell in question.

In our sample we have:
A1 = -25, B1 = 0, and C1 = 31

Now, suppose from A7 to AA7 contains the following value:
-20, -7, 12, 15, 25, and 31.

Let said we test in cell B7, C7, D7, and E7 for the value between A1 and B1.
Thus, we would have -20 in cell B7, -7 in C7, and so on.

Let we test the result of B1 to C1 in cell B8, C8, D8, E8, and so on.
In this case, we would have a value 12 in B8, 15 in C8, 25 in D8, 31 in E8, and so forth.

Again sorry.
Thanks.

Reply to David Scott