Can someone please help me.
I need a formula for cell D2 that will return the mileage value from sheet 1 by comparing it to the information from sheet 1.
ie. if (location = bobs) + (term = HLN) miles = 167
heres the catch,
If (truck=cc) miles=0
Last edited by simpson; 11-18-2011 at 03:28 PM.
Try:
=IF(B2="cc",0,INDEX(Sheet1!$B$4:$D$7,MATCH(A2,Sheet1!$A$4:$A$7,0),MATCH(C2,Sheet1!$B$3:$D$3,0)))
copied down
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
that works! you are awsome.
thanks again!
FWIW
Once again I charged down the dynamic names route and arrived late!
I'll post it anyhow as it's done.
This table can be expanded with as many rows and columns as you need.
If you need any more information, please feel free to ask.
However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
Also
If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.
Does every question require dynamic range solutions?
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
@ NBVC
Not really, but several posts recently have been about this type of question.
The actual worksheets have ended up many times larger than the original sample.
The solutions end up with volatile dynamic ranges.
Then the OP complains the worksheets is painfully slow.
Guess I've just got a bee in my bunnet!
I am with you Marcol. Dynamic Ranges are a quick and easy way to optimize your workbook. Especially if the person who will ultimately be in charge of using or maintaining the file is not an Excel expert. The speed difference between a dynamic range and just referencing a large range like A1:A100000 isn't all that much, and not usually noticiable, but it prevents the need to maintain it in the far future when you've forgotten how the workbook is organized. And the self documenting bonus of naming your range is a huge plus.
Plus I just like the coolness of the INDEX approach for dynamic ranges.
I agree but it isn't always necessary, not all spreadsheets are going to use ranges into the 1000's of rows....
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
If this helps.....
the worksheet i will be applying the formula to is very different then the sample. It will still take some time to imput the formula and make it work.
The solution worked in my sample great, but when I transfered it to the actual sheet and modified it I am coming up with the location name from column A instead of the mileage from column D.
I'll keep plugging away though.
I'de like to show you guys the actual workbook sometime. I've been told it is quite impressive. but it is slow to open. It really should be an access database but i'm running into a wall getting started on that progess.
thanks to all!
Here is a good website that teaches you the Index/Match combination:
http://www.contextures.com/xlfunctions03.html
It also shows you how to create dynamic named ranges, if you need them:
http://www.contextures.com/xlnames01.html#Dynamic
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
here is a better sample of the actual. If your interested.
Try:
=IF(C2="cc",0,INDEX(Sheet1!$B$4:$F$14,MATCH(A3,Sheet1!$A$4:$A$14,0),MATCH(Q3,Sheet1!$B$3:$F$3,0)))
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
@ Whizbang, forget the "Coolness"
The fact that INDEX(MATCH()) isn't volatile makes a large workbook very workable when volatile functions like OFFSET() grind to a halt.Plus I just like the coolness of the INDEX approach for dynamic ranges
The penalty to pay is that the workbook is slower to open because INDEX(MATCH()) is "quasi-volatile" at this stage only, but what's that compared to a sheet that opens in a flash then dies when you enter anything?
Thats crazy!
You must be able to figure that out faster then I can even type the question.
For the record only, here it is with your data applied.
Add to Sheet1 ColumnA as required, add more Columns for "Terms"
Select from the dropdowns in Sheet" Columns A and Q
If you need any more information, please feel free to ask.
However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
Also
If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks