Find Address Of MaxIF In A Range

Apr 4, 2007

I am having troubles with using two methods together. I know how to find the address of the first or last occurance of a MAX in a range. I also know how to create a MAXIF function using criteria to determine what to consider for the max calculation. I do not know how to return the address of the result from the MAXIF.

I am using Office 2003 on WinXP.

Ultimately I want to take the address of the first result of a MAXIF and use it to do a lookup for a corresponding value. I'm not sure if I will be able to do this with a combination of functions, or if I will need a macro.

Heres an example:

Data:

Time WeekNum Count
01:02 1 12
02:05 1 35
03:09 2 456
14:20 2 123
12:24 2 122
Usage:

Use the maxif lookup to return the time of the largest count for WeekNum 2

Result:
03:09

View 9 Replies


ADVERTISEMENT

MaxIf Across Discontinuous Range - VBA Or Formula

Sep 6, 2013

I want to create VBA code, or a formula that achieves MaxIf across a Discontinuous Range.

I already have the basic Max If array formula which works in another place:

{=MAX(IF(EditAsset_MaintenanceType="Scheduled Maintenance",EditAsset_MaintenanceDateUndertaken))}

Where each named range is a column of 20 continuous cells.

This actually sits within a larger formula {=IF(MAX(IF(EditAsset_MaintenanceType="Scheduled Maintenance",EditAsset_MaintenanceDateUndertaken))=0,EditAsset_DatePurchased+(EditAsset_MaintenanceCycle*30.4167),MAX(IF(EditAsset_M aintenanceType="Scheduled Maintenance",EditAsset_MaintenanceDateUndertaken))+(EditAsset_MaintenanceCycle*30.4167))}

Now I need to achieve a similar thing, but in a master list of all the data which necessitates a different layout so the data can't be in 2 columns, and can't be continuous. So:

Max the dates in cell BE7, BI7, BM7, BQ7, BU7, BY7, CC7, CG7, CK7, CO7, CS7, CW7, DA7, DE7, DI7, DM7, DQ7, DU7, DY7, EC7...

...IF the value of the corresponding cell two columns to the left of each is "Scheduled Maintenance",

e.g. cells BC7, BG7, BK7, BO7, BS7, BW7, CA7, CE7, CI7, CM7, CQ7, CU7, CY7, DC7, DG7, DK7, DO7, DS7, DW7, EA7

I tried creating 2 named ranges (one for the cells in each bullet point above) and using that in the array formula, but that didn't work and as this formula needs to go down 8,000 rows it would require 16,000 named ranges which isn't really practical.

Ideally I think I would perform this calculation in VBA and just output the answer to the relevant cell. [The VBA code will be triggered via a Worksheet_Change event when one of the date cells, or the 'maintenance cycle' cell elsewhere is changed].

I think this could be done by taking the values from the cells above into two arrays, and then 'max if' those arrays within VB somehow - but I don't know how to create the arrays or then perform 'max if' within VBA.

Alternatively a formula would suffice - I could insert this formula into the output cell via the VBA Worksheet_Change event when an input cell (date or maintenance cycle) is changed, and then have the same VBA code copy this cell and paste the value - can't have up to 8,000 array formulas live in my sheet for performance reasons! But I don't think this will be easily possible via a formula and VBA would be cleaner.

View 7 Replies View Related

Find Value In Range Then Return The Cell Address?

Mar 16, 2014

construct a formula that finds a value in a range , then returns the cell address of that value.

Say, i wanted to find the amount 12385 from another sheet , range C2:AA12 (contains only numbers , no duplicates). result should give me the address of that value.

I have tried the address & match function but gives me an N/A error.

View 3 Replies View Related

.range.find Need To Return Cell Address

Nov 14, 2007

when I use the range.find function to find a certain value in a column.. i want to return the address of the cell.. and save it in a range variable. how would I do that?

so this is what i have now.. but Rng does not return as a range.. it returns 69... when i use ctrl + G and type ?rng

set rng = .range(A:A).find(what:=69, After:=.Cells(1, 1), Searchorder:=xlByRows, searchdirection:=xlPrevious)
ok so say it picks up..... cell A69... how do i get it to save range A69

View 9 Replies View Related

Lookup Functions Find The Address Of The Minimum Value In That Range

Sep 19, 2009

I have a range of cells (say A1:D8).
I wanna find the address (say $B$2) of the minimum value in that range.


This command does it but it only works on a column. it does not accept a range spanning more than one column.
=CELL("address",INDEX(B2:B7,MATCH(MIN(B2:B7),B2:B7,0)))
this will tell me the address of the minimum value.. but in a column... I need a range of many columns.

So I tried converting things to a Table.. but it never worked. basically the MATCH command is my problem. It only accepts single-column-ed ranges.

View 13 Replies View Related

Using Macro To Find Email Address In Address Book Of Outlook

May 22, 2014

I am struggling to find a macro which can look at a name in column 'BT' and search it in the address book of Outlook to then place the email address of that person in column 'ED'

There are 35,000+ people in the address book and there may be over 5 email addresses for one name, so is there any way a message can appear for the user to select which email address is correct if there is more than 1 contact for that name?

View 1 Replies View Related

MaxIf Function

Oct 20, 2009

I would like to write a formula that looks at the last month with a percent value greater than zero, then return the percent value in a specific cell. In the example below I want to display 85.0% in the cell. It should update each time data is entered for the following month.

Here is the source:

MonthPercentage
October 96.0%
November 2.0%
December 70.0%
January 85.0%
February 0.0%
March 0.0%
April 0.0%
May 0.0%
June 0.0%
July 0.0%
August 0.0%
September 0.0%

View 9 Replies View Related

Maxif Function In Vba

Nov 10, 2004

I want to write a reuseable maxif function in vba. The following code is working when entered directly into the cell:

= SUMPRODUCT(MAX((B1:B6=B2) * (A1:A6)))

Now I want to pack this function into vba code to make it commonly available. I tried it with the following code but it doesn't work. I assume there is a problem with the passing of the range parameters. I also tried it with String and Variant as parameter types - without success. Can anybody help me?

Public Function MaxIF(criteriaRange As Range, searchValue As Variant, calcRange As Range)

AciveCell.Formula = "=SumProduct(Max((criteriaRange = searchValue) * (calcRange)))"

End Function

View 5 Replies View Related

MAXIF And MINIF Functions With Wildcards

Jul 16, 2009

I have a list of bank transactions in a spreadsheet

for example....

1/7/09 Sainsburys Petrol 34856385
4/7/09 Paypal 92017465
6/7/09 Sainsburys S/Market 38264059
8/7/09 Halfords 93862830
11/7/09 Sainsburys S/Market 34957372
13/7/09 Paypal 92037454
14/7/09 Barclays BCC 173256

and wish to use formulae similar to MAXIF and MINIF to find the last date and the first date of Paypal transactions (for example) if I have just the word "Paypal" in cell D1

I've tried
=SUMPRODUCT(MAX(($B$1:$B$7=$D$1)*$A$1:$A$7))

but obviously this is looking for exact match of "Paypal"

I have successfully used a wildcard in SUMIF functions elsewhere...

eg, $D$1 & "*"

but for some reason
=SUMPRODUCT(MAX(($B$1:$B$7=$D$1 & "*")*$A$1:$A$7))
does not work

Does anyone have any suggestions?

View 12 Replies View Related

How To Find The IP Address From A Hostname

Jan 25, 2014

I have a excel worksheet that contains hostnames in column a. I want to run the dos cmd "tracert "hostname from column a", then, import the IP address from the cmd results in column b of my worksheet.

View 2 Replies View Related

Find A Cell Address

Dec 8, 2008

I have the following macro written:

Sub GT()Dim cell As rangeDim BeforeNull As StringDim FirstNull As StringDim InitialData As StringDim B As VariantFor Each cell In range("A1:A8")Alpha:InitialData = cellFirstNull = InStr(1, InitialData, " ", vbTextCompare)If FirstNull = 1 ThenInitialData = Right(InitialData, Len(InitialData) - 1)cell = InitialDataGoTo AlphaEnd IfIf FirstNull "" And FirstNull "0" Then BeforeNull = Trim(Left(InitialData, FirstNull - 1))If FirstNull = "" Or FirstNull = "0" Then BeforeNull = InitialDatacell = BeforeNullNextEnd Sub

Now after the final Next, I need the macro to select the last cell changed. Is there a way to do this?

View 9 Replies View Related

Find Cell Address

Feb 7, 2007

Find the cell address where the user created button placed in excel.

View 2 Replies View Related

Get The Range Address Of A Dynamically Named Range That Refers To A Formula In VBA

Aug 10, 2008

I have a named range that expands and contracts based upon the amount of data that is in some column. Call it AllData_UsedRange.

I have another named range that actually refers to a range. Call it AllData.

Column A
Row2 56
Row3 44
Row4 65

AllData is a named range that refers to the range A2:A65536
AllData_UsedRange refers to A2:A4 by way of this formula.
=OFFSET(AllData,0,0,COUNTA(AllData))

How to I obtain an address of AllData_UsedRange in VBA code?

These do not work...
ThisWorkbook.Names("AllData_UsedRange").RefersToRange.Address
Evaluate(ThisWorkbook.Names("AllData_UsedRange"))

View 9 Replies View Related

Find Cell Address Containing Value Within Array?

Oct 5, 2013

In the following example, I need to create a formula to identify the cell address containing the string value "X"

BCDEFXABCDEFXABCDEF

Assuming this was row A, the formula needs to return $A$6 (or A6).

View 7 Replies View Related

How Do I Find Address Of Cell Containing Maximum Value

Aug 29, 2005

I'd like to have the cell address returned along with a value when I use the
MAX function.

View 13 Replies View Related

Function To Find The Address Of A Cell

Dec 8, 2005

I want a function that allows me to enter a range and then returns
the address of the cell with the minimum value. It is the Address I am
interested in, not the value.

View 14 Replies View Related

Find Cell Address Within A Table

Mar 3, 2007

Does anyone know the formula that produces the address (e.g. $A$1) of a cell within a table? I found the formula that gives the address of a single cell within a single row (or the address of a single cell within a single column). But I need the formula that gives the address of a cell where the row intersects the column. If I know the column header name and the row header name, how do I find the cell address for the two dimensional intersection?

View 11 Replies View Related

Find A Cell Address From An Area

Mar 8, 2009

I am trying to find a cell address from an area, like this:

  A  B  C
1
2   hello
3
4

I need to find "hello" 's address from A1:C4, I found that the function MATCH works in single row/columns only.

View 2 Replies View Related

Getting Chart Range From Range Address Contained In A Cell

Dec 3, 2013

I have a Choose function that is used to determine which range I need. e.g. =Choose(Choice,Cell,Cell,...).

In each corresponding "Choice" cell is a typed range. e.g. $B$33:$L$70

I'm looking for a way to be able to use this typed range as the range for some chart data.

View 2 Replies View Related

Match Named Range To Range/Cell Address

Aug 25, 2006

I know that I can return the value of a defined name range, the address, and even the value of the define name, but if you are given a range address, how do you find its corresponding defined name in code?

View 4 Replies View Related

Using Index / Match In VBA To Find Cell Address Not Value

Jul 1, 2014

I have a data table, called Table1 in Sheet1. In a simple form it is

Customer ID
Comment

A
asdf

B
jkl;

So in VBA, I need to figure a way to give me the cell address of the matching cell in Comments. So say Customer ID starts at A1 ... that means the Comment for Customer A is B2.

How would I get that reference in VBA?

View 2 Replies View Related

Find Address And Return GPS Location From Another Sheet

Jun 3, 2014

I have a table with customers and their addresses (sheet2) and I need to find their GPS locations in sheet1.

I guess the logic would need to be something like this:

find CityName and StreetName in sheet1 where StreetNo is between minStreetNo and maxStreetNo return GPS X and GPS Y

with the formula or VBA code?

Example.xlsx

View 2 Replies View Related

Find Cell Address For Last Entry In Column

Oct 22, 2007

i had this formula at one time but lost it.

i am trying to figure out how to evaluate a column and get the cell address of the cell with the last entry

example

--A
1 e
2
3
4 g
5
6 h

all other cells under A6 are blank

the answer is A6

View 9 Replies View Related

Find & Use Cell Address To Offset On Another Worksheet

Jul 27, 2007

I'm still getting to grips with the Find Command. Basically, I have the below code that looks at a line in a sheet(ws_Site) based on the Line ID Number that is in column A and then Finds that that LineID_Value in a different sheet(ws_main) and copies a value from column I on that line across. Problem is, if the cell I is blank it copies it across and essentially clears the cell if there was data in it.

How can I adjust the below code to only set ws_main.Range(c.Address).Offset(0, 8).Value = LineID_Value if LineID_Value is not blank?

For Each LineID In ws_Site.Range("A7:A" & SiteRows) ' Loop through all the cells in range

LineID_Value = LineID.Offset(0, 8).Value

'Dim c
With ws_main
Set c = .Range("A7:A3000").Find(LineID, LookIn:=xlValues)
'If Not c Is Nothing Then

ws_main.Range(c.Address).Offset(0, 8).Value = LineID_Value

'End If
End With

Next LineID

View 3 Replies View Related

Find Cell Address Of VLOOKUP Result And Replace With New Value

Jun 21, 2013

I am using VLOOKUP to find the size of a cam to be installed in a tablet press, based on the product code it will be running.

The array has two columns: (W) Product Code, (X) Cam Size.

Array: W4:X437

The user selects the Product Code from a drop-down list in cell E5.

The resulting Cam Size is displayed in cell E7. The VLOOKUP works fine.

=IFERROR(VLOOKUP(E5,W4:X437,2,FALSE),"")

Occasionally, the cam size has to be updated. The user would then select a new cam size from a drop-down list in cell E9.

I have a "Update Cam Size" command button.

What I need to happen is for the value in E9 to replace the value in the array that is displayed in E7. Obviously, I have to know the location of the cell in the array, but I can't figure that part out. I've tried ADDRESS and MATCH functions, but it comes back with "#N/A" Value not available error.

=ADDRESS(MATCH(E7,W4:X437,0),2)

View 3 Replies View Related

Formula To Find Text And Return Its Cell Address

Sep 6, 2013

Is there any formula to find text and return its cell address? This is like when we use Ctrl+F function to find a text, and Excel then highlight the cell contains the referred text. At the same time, the name-bar displays the address of the cell. Now, is there any formula that can perform such task like this?

View 9 Replies View Related

Find Out What Row Or Cell Address That The VLOOKUP Found The Data

Dec 18, 2008

When I use VLOOKUP formula within a VBA routine ex:
For LoopCounter = 1 to LastRow
With Worksheets("0MATERIAL")
.Cells(RowCounter, 5).FormulaR1C1 = "VLOOKUP(RC[-2],'0MAT_UNIT'!R1C1:R65520C12,4,FALSE)"
End With
RowCounter = RowCounter + 1
Next LoopCounter

How can I find out what row or cell address that the VLOOKUP found the data? The above code works perfectly but the problem is I need data from that same row in columns 4-11. I replicated the .Cells line above and made each one a VLOOKUP (for column 4, 5, 6, etc...) but this kills the performance. I have around 32,000 rows in sheet 0MATERIAL and around 50,000 rows within sheet 0MAT_UNIT

View 9 Replies View Related

Macro To Find Required Data Than Copy/paste In Specific Cell Address

Nov 4, 2009

I want to copy some data from internet and paste it in to worksheet location Range A1:A30. the data look like following information.

LocationKuwaitP.O.Box:4819 SafatAddress:ShuwaikhTel:-22253580Fax:-24343645Category:CONSTRUCTION COMPANIES

the above information have following header ie. Location, P.O.Box, Address, Tel, Fax and Category.

every time one of the header inforamtion is missing ie. Address or P.O.Box, Or Fax, due to this problem every time cell address of information aganist header is change. supose in first copy/paste Tel inforamtion is in A15, but second time it may be on A13, and 3rd time it may be on A17 and so on.

I want to make a macro which search header ("Location", "P.O.Box", "Address", "Tel", "Fax", "Category" ) from a Range A1:A30. than down two steps to copy header information (75325412) and paste in fixed cell location C1:C5 (C1=Name, C2=Location, C3: P.O.Box, C4=Address, C5=Tel, C6=Fax, C7=Category) in same sheet. and repeat the steps to copy information aganist header from all header in Range A1:A30.

View 9 Replies View Related

VLookup IP Address In A Range

Apr 12, 2012

I am attempting to categorize IP Addresses. My lookup table looks like this:

Begin End Category
1.50.50.0 1.50.50.255 3
5.185.40.0 5.185.43.0 2
5.22.22.65 5.22.22.128 5

I have a list of IP addresses that need to be categorized.

IP Address Category
5.185.41.15 2
1.128.128.0 Null
1.50.50.128 3

The category column needs to be populated. The ranges in my look up table are not end to end (there are gaps).

Function Lookup got close, but assumed there were no gaps.

View 4 Replies View Related

Convert IP Address To IP Range

Jan 29, 2014

I have a list of random I.P. Addresses i.e. 192.168.1.0, 172.19.16.0 etc

i would like to copy them into another cell but change them to a range. i.e.

192.168.0.1-192.168.1.254
172.19.16.0-172.19.16.254

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved