PDA

View Full Version : [SOLVED:] VBA Function - Search Min Value by length



sanju2323
03-01-2015, 12:10 AM
Search the minimum value in accordance with the length. VBA Function & Sub VBA

Bob Phillips
03-01-2015, 05:03 PM
You don't like to explain yourself much do you?

Put this array formula in D3 and copy down

=IF(A3=MIN(IF(CEILING(B3,$G$1)=CEILING($B$3:$B$36,$G$1),$A$3:$A$36)),"Min","")

sanju2323
03-01-2015, 05:58 PM
Sir , need required result as shown in column "C"

Aussiebear
03-01-2015, 09:54 PM
I have read both your request and have looked at your workbook. I'm afraid I'd have to agree with Xld here. Can you upload a new workbook showing a before and after sheet.

What is the relationship between Value, Length & Requirements?
What is the relationship between "Find Min value every length" and the value in G1?
Which length is the value to be used B2:B or G1?

sanju2323
03-01-2015, 10:41 PM
I Need Result Just like that formula, but we need result without use array formula because If you are using a large format sheet will hang.


=MIN(IF(($B$1:$B$100>FLOOR(B3-1,G$1))*($B$1:$B$100<=CEILING(B3,G$1)),$A$1:$A$100))
Confirm with Ctrl + Shift + Enter (Array formula entry)

Bob Phillips
03-02-2015, 01:20 AM
Sir , need required result as shown in column "C"

Then use

=MIN(IF(CEILING(B3,$G$1)=CEILING($B$3:$B$36,$G$1),$A$3:$A$36))

Aussiebear
03-02-2015, 04:10 AM
So what or rather how was the result 17 arrived at for the first 10 rows? Or the result 5 arrived at for the next 8 rows? By using XLD's formula to overwrite the values in column C you have simply added confusion to the issue.

sanju2323
03-02-2015, 05:38 AM
i apologize to all people had to suffer, because of me. thank you very much for all the changes I made to help though.

Aussiebear
03-04-2015, 04:53 AM
I have asked 5 questions to date which you have no bothered to answer. How are we meant to assist you if you don't explain yourself or respond to questions to clarify points of interest? You need to remember that you are using an international forum to find a solution to an issue, This means we need an adequate description of the event or issue, which should include a sample of the data as you see it, and an expected result. By doing this you overcome both any discrepancies due to language, and more importantly overcome both the fact That we are unable to read your mind or oversee the data to which is currently "For your eyes only".