HussainAlqatari
New Member
 Joined
 Jun 17, 2020
 Messages
 3
 Office Version

 2007
 Platform

 Windows
Hello everyone,
I am using EXCEL 2007, and having this problem, which I think, tricky but easy to understand:
Column A and Column C both contain INPUTS (all are numbers).
Column B should contain OUTPUTS. (Which is the problem).
The problem in words: Look at Column A, Find the greatest number which is less than or equal to the least number in Column C. Once you find that, return 1 in Column B.
Again, Look at Column A, Find the greatest number which is less than or equal to the second least number in Column C.
Once you find that, return 1 in Column B.
Again, Look at Column A, Find the greatest number which is less than or equal to the third least number in Column C.
Once you find that, return 1 in Column B.
And so on,
Return 0 in Column B for other cells
See the following example:
INPUTS:
OUTPUTS:
The 1 beside 5 because 5 is the greatest number in Column A (which is less than or equal to 7, which is the smallest number in Column C)
The 1 beside 11 because 11 is the greatest number in Column A (which is less than or equal to 12, which is the second smallest number in Column C)
The 1 beside 11 because 11 is the greatest number in Column A (which is less than or equal to 19, which is the third smallest number in Column C) (This happened earlier with 12)
The 1 beside 20 because 20 is the greatest number in Column A (which is less than or equal to 20, which is the fourth smallest number in Column C)
The 1 beside 89 because 89 is the greatest number in Column A (which is less than or equal to 100, which is the fifth smallest number in Column C)

* INPUTS should not be changed or sorted.
* Column A has no duplicate numbers.
* Column C has no duplicate numbers.
* The OUTPUTS are typed manually for illustration.

I tried to combine the following functions; AND(), IF(), COUNT(), SMALL() ,,, but did not work
Can one use those function, or others but not vba, to solve this problem? I believe, but not sure, it is possible with only these functions.

Sorry for my poor English (I am Arabic). If my way of explaining my problem is not clear, then please ask me to clarify more. If you understood it, but could not solve it, then it would be really appreciated if you rephrase it, so other members may help me. THANKS IN ADVANCE!
I am using EXCEL 2007, and having this problem, which I think, tricky but easy to understand:
Column A and Column C both contain INPUTS (all are numbers).
Column B should contain OUTPUTS. (Which is the problem).
The problem in words: Look at Column A, Find the greatest number which is less than or equal to the least number in Column C. Once you find that, return 1 in Column B.
Again, Look at Column A, Find the greatest number which is less than or equal to the second least number in Column C.
Once you find that, return 1 in Column B.
Again, Look at Column A, Find the greatest number which is less than or equal to the third least number in Column C.
Once you find that, return 1 in Column B.
And so on,
Return 0 in Column B for other cells
See the following example:
INPUTS:
OUTPUTS:
The 1 beside 5 because 5 is the greatest number in Column A (which is less than or equal to 7, which is the smallest number in Column C)
The 1 beside 11 because 11 is the greatest number in Column A (which is less than or equal to 12, which is the second smallest number in Column C)
The 1 beside 11 because 11 is the greatest number in Column A (which is less than or equal to 19, which is the third smallest number in Column C) (This happened earlier with 12)
The 1 beside 20 because 20 is the greatest number in Column A (which is less than or equal to 20, which is the fourth smallest number in Column C)
The 1 beside 89 because 89 is the greatest number in Column A (which is less than or equal to 100, which is the fifth smallest number in Column C)

* INPUTS should not be changed or sorted.
* Column A has no duplicate numbers.
* Column C has no duplicate numbers.
* The OUTPUTS are typed manually for illustration.

I tried to combine the following functions; AND(), IF(), COUNT(), SMALL() ,,, but did not work
Can one use those function, or others but not vba, to solve this problem? I believe, but not sure, it is possible with only these functions.

Sorry for my poor English (I am Arabic). If my way of explaining my problem is not clear, then please ask me to clarify more. If you understood it, but could not solve it, then it would be really appreciated if you rephrase it, so other members may help me. THANKS IN ADVANCE!