Categorizing Column Values Using Multiple Criteria

BrotherDude

Board Regular
Joined
Sep 11, 2013
Messages
50
Hello all,

I am working with an aging report where data is formatted in column. In the last column I would like to assign a value based on criteria from the adjacent columns (ex: If balance > $10,000 then value = "Hold").

My idea was that I would asign variable to the column, start a for next loop, and insert the criteria in an if then else loop. Is this the best way to go about it, should I be using case select, and how do best assign the variable to column so that I can loop down the entire report.

Here's an example of what I'm working with

Balance Current 90120150180+ Pymt to Date Last Pymt Last Pymt Status
230,426.63 157,857.42 6,300.00 4,546.14 16,600.00 45,123.07 87,341.487/17/2014 13,150.00"Hold"
154,665.00 154,665.00 - - - - 35,000.007/14/2014 25,000.00?
143,672.80 136,255.95 8,250.00 5,096.85 (4,830.00) (1,100.00) 26,145.237/25/2014 2,140.00?

<colgroup><col><col><col><col><col span="2"><col><col><col><col></colgroup><tbody>
</tbody>


any suggestions are greatly appreciated,

- Jeff
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Do the following:

1) Create a range name for the numbers in the Balance column. Call it Balance.
2) Highlight the cells in the Status column.
3) Press F2, which lets you enter a formula in the first cell of the Status column.
4) Type the following formula (DON'T PRESS ENTER).

=IF(Balance>100000,"HOLD","?")

5) Press Ctrl+Shift+Enter. This creates an array formula which does the IF test for each number in the balance column. In the formula bar you will
see braces surrounding the formula. Excel is telling you that you created an array formula. There is no need to get into VBA to do this.
 
Upvote 0
This would need to be a VBA solution as the number of criteria is simply too high to fulfill with a formula, the balance example would be the first of up to 15 different criteria I want to use to define a status. I guess my biggest questions are, how should I define the cells in the adjacent columns as the vba loops down the report (should I just use cell column references or can I name column and/or set variables for more for flexibility in the code), and second, should I we using elseif or select case for the criteria?
 
Upvote 0

Forum statistics

Threads
1,216,165
Messages
6,129,235
Members
449,496
Latest member
Patupaiarehe

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top