MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 23rd, 2002, 11:58 AM   #1
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

I swear to God in Heaven that I didn't change a THING in the formulas, and now it's not working right. I'm going to try to recreate the issue. Be patient.

In Column B, I've got a Unit Code repeated as many times as there are different Diagnosis Codes in Column D. Therefore, Column B will look like this:

41900
41900
41900
41900
41900
41900

In Column C, I've got a Test Name, again, repeated as many times as there are variations in Column D:

Alpha Fetoprotein
Alpha Fetoprotein
Alpha Fetoprotein
Alpha Fetoprotein
Alpha Fetoprotein
Alpha Fetoprotein

In Column D, I have these different Diagnosis Codes:

235.3
235.4
571.40
571.41
571.49
789.1

And, finally, in Column E I have the Descriptions of what the codes mean:

Liver and biliary passages
Retroperitoneum and peritoneum
Chronic hepatitis, unspecified
Chronic persistent hepatitis
Other, chronic hepatitis
Hepatomegaly

Now, on my lookup sheet (for the end users), I have the following formulas:

In cell B8, based on the Unit Code typed in cell B6, is this formula, used to pull in the test name:

=IF(COUNTIF('CPT DATA'!$B:$B,B$6),INDEX('CPT DATA'!$C:$C,MATCH(B$6,'CPT DATA'!$B:$B,0)),"ABN not required for this procedure")

In cell B13, this formula searches the data sheet for the code in B6 and brings back the first matching Diagnosis Code:

=IF(COUNTIF('CPT DATA'!$B:$B,B$6),INDEX('CPT DATA'!$D:$D,MATCH(B$6,'CPT DATA'!$B:$B,0)),"")

In cell B14, this formula brings back the NEXT consecutive Diagnosis Code matching the Unit Code:

=IF(COUNTIF('CPT DATA'!$B:$B,B$6)>ROW()-D$5,INDEX('CPT DATA'!$D:$D,MATCH(B$6,OFFSET('CPT DATA'!$B$1,MATCH(B13,'CPT DATA'!$D:$D,0),0,$D$4,1),0)+MATCH(B13,'CPT DATA'!$D:$D,0)),"")

I think the formulas that pull the description up alongside the Diagnosis Code are fine. Also, there are formulas that determine the number of rows to search. Aladin gave me ALL of these (the angel!!).

The problem is that I've checked and rechecked these formulas to make sure they're the same as they were last week when they worked, and they appear to be, but the information being pulled in is always ONLY the FIRST unique Diagnosis Code (column D). Sometimes it repeats three lines down, sometimes 10...seems to be an arbitrary number of times, though the formula is copied down to almost infinity on the worksheet.

Why would this happen? The formula seems to be increasing one row number like I would think it should.

The only thing I can think of that has changed is that I have been inserting rows on the data sheet to make room for all the data I have to paste in there from another source (that's the only way to do that particular part of it). I've checked to make sure the cell formatting is staying the same, and it is.

I must sound like the biggest idiot, but I could really use some assistance. If there's anything I didn't explain well enough, let me know.

I really do have other talents. This is just not one of them.


invisigirl is offline   Reply With Quote
Old May 23rd, 2002, 12:23 PM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,318
Default



I just attempted to replicate using the data you mention. Nothing unusual. The formulas retrieve the diagnoses and descriptions associated with 41900.

It might be the case that the additions you make do not have the same underlying format (that's the format which Excel sees as the rest of data.

If you want me to look at your WB, here is my e-mail address:

aladin_akyurek@yahoo.com
Aladin Akyurek is offline   Reply With Quote
Old May 23rd, 2002, 12:24 PM   #3
Rocky E
Board Regular
 
Join Date: Feb 2002
Location: North Alabama, USA
Posts: 105
Default

Well you got it to work once you will get it to work again. I tried to build a sheet, but you must have left something out or I don't understand. Anyway the first thing I would do is make a copy of what you have. Then disassemble your compound IF blah blah and make some simple diagnostic cells that work. Then once you get the bits working the way you want start pasting things back together. Basically tear it apart until it works. Then put it back together without breaking it.
__________________
Hope this helps!

Rocky

<h6>"Be not the first by whom the New are try'd,
Nor yet the last to lay the Old aside."
Alexander Pope (1688-1744).</h6>
Rocky E is offline   Reply With Quote
Old May 23rd, 2002, 12:26 PM   #4
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

Will do. My name is April, by the way, in case you think it's someone sending you a virus.
invisigirl is offline   Reply With Quote
Old May 23rd, 2002, 12:28 PM   #5
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

April,

Don't forget to send the coffee cake to Aladin

Brian from Maui is offline   Reply With Quote
Old May 23rd, 2002, 12:31 PM   #6
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

Thanks, Rocky. If Aladin is stumped (though that'd shock me!), I'll try it. The formulas themselves are pretty darn confusing to me, so I was hesitant to try to mess with them further.

Love your quote, by the way.
invisigirl is offline   Reply With Quote
Old May 23rd, 2002, 12:32 PM   #7
invisigirl
Board Regular
 
Join Date: Mar 2002
Location: Oregon
Posts: 130
Default

LOL, Brian! I'm better at pie, actually. Since you're from Maui, I can send you my recipe for banana-guava pie if you want.
invisigirl is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:08 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes