# Using If Statement To Produce Results Based On 2 Cells

Nov 25, 2011

I was trying to use an if statement to produce results based on 2 cells. The number in the 1st cell can be the number 1 to 5, but each number has critera with it. Say the cell is A1 and i enter the number 1. Then i want to check the value of Cell A5, if this is less than 40 then the cell A10 should read 250 and if A5 was over 40 then it should read 285. struggled to get a formula properly to work.

Here are the values for each number: A1 = 1 with cell A5

## IF Statement Does Not Produce Required Results: Resulting In Zero Values In Most Conditions

May 25, 2009

I have a work sheet which includes a column of numbers representing certain daily events. I am building a user defined function to analyse the trend in the numbers by assisigning values from -2, -1, 0, 1, 2 based on comparison of two days.

Below is the function I built but it is not working, it is resulting in zero values in most conditions. I have attached the sheet which includes the numbers and the function.

## Transfer Results Of IF Statement To Another Tab And Ignore Blank Cells?

Apr 15, 2014

I've got a work book (2010 btw) with several tabs.

On tab 5 is an inventory list with "Stock Number and Nomenclature" merged in row A7-Q7 and down to row A23-Q23.

Beside each Item there are “Required Quantities (EA)" in Colum U7-U23. After an inventory is executed, The values are placed in Colum V7-V23 (INV).

Stock Number Nomenclature EA Inv
34419-43450 Mission Modu 1 “X”

After inventorying.... I need a formula that "compares the required quantities (EA) to the actual inventoried values (X)".

IF the actual inventoried quantities are equal to or greater than "Required Quantities" - Display Nothing in tab 6

IF the actual inventoried quantities are LESS than the "Required Quantities" - Display “Stock Number and Nomenclature" in tab 6 for a shortage list, ignoring the "blank cells".

## Generating Text For Cells Based On Results Of Formula?

Aug 14, 2013

So basically I have a spreadsheet that tracks if a patient has turned in there required paperwork within the last 6 months and then changes the cell to white and lets me know how many days they have left until they are due to turn this paperwork in again. Then if it has expired I have a condition format change the cell to Red but I would like to add in the text EXPIRED to the cell. lastly I have Cells that have no data in them gray and I would like to add in red text saying No Paperwork.

I'm hoping this will be my last build of this spreadsheet so I can go ahead and start applying it to the real workbook [URL]

## Match 2 Cells To Produce A Third Value

Sep 7, 2009

I have 2 sheets of data one for data the second for input and calculations.

SHEET 1 (Data)
A / 81
C / 99
E / 01

SHEET 2 (Input & Calculations)HEADINGS - FROM / TO / FROM val / TO val

I want to be able to stick "A" in Col1 (FROM) and the number 81 to automatically appear in Col3 (FROM Val). I am unabel to use LOOKUP as my Pocket PC doesen't recognise it.. VLOOKUP and HLOOKUP are ok though, I just can't seem to get them to work for me.

## Produce Numerous Workbooks Based On Filtered Names

Oct 25, 2012

I am trying to produce numerous workbooks based on a filtered name. I will attach a sample spreadsheet that has the data.

On the sheet we have engineer names. I basically want to filter them (not difficult with a macro) but then to copy the results to a new spreadsheet and save the workbook as the engineers name (ie J. Bloggs has 5 jobs so they are filtered and the results are dumped into a new workbook and then saved as J. Bloggs.xls). This will happen for all engineers.

I have though about doing it as a macro and I think that would give me the end result but we have around 20 engineers and these can sometimes go up and down. Is there anyway to do this automatically?

Test Cost report 1.xls

## List Unique Entries And Total Cells Based On The Results

Jun 10, 2008

Basically from Sheet OEE V20:V500 I have a list of problems being selected from a drop down list validation (which users can add to the list for new problems). Along side these "problems" in Sheet OEE U20:U500 I have a number which represents the number of minutes the problem caused them. Some cells in both these columns will however be empty if there was no problem occour. But wherever there is a problem selected, there will be a number alongside it, there will never be one without the other.

What I want to do is look down Sheet OEE V20:V500 and get two lots of information -

The unique problem names (no duplicates of the same problem) in Sheet Reports A1:A100 for example (I may change the range of this).
The number of occurances of each of the problems it lists in Sheets Reports B1:B100.
Count up the total number of minutes of each problem. So for every occurance of "Paper problem" there will be a unique number in Column U in the same row as the problem and place this in Sheet Reports C1:C100.

I would ideally like to have this as VB code as I am going to tie it into a command button which formats and prints my report page.

I have found various bits of code dotted about the forums for counting unique cell entries but they always seem to produce a list with lots of blank rows (I would like a list one after another without blank rows all over the place) and I'm really struggling to figure out how to make it count up the numbers in the adjacent cell of each entry it sees.

Just in case the list of problems for the cell validation in Sheet OEE V20:V500 is found in Sheet OEE AQ16 downwards.

## Comparing Two Cells Of Data To Produce A Comment

Sep 10, 2009

is it possible to compare two sets of data (can be numerica or alpha) and produce a different outcome comments.

Attached workbook might explain better.

## Produce List Of Row Data Based On User Selected Cell Criteria?

Apr 7, 2014

I have a workbook that has three worksheets. The ASU Database sheet contains part numbers and descriptions including specific details that are selected from pull down data validation lists that are named on the third worksheet. I want to have a front end on the first worksheet that has similar data validation lists for the user to select from to create a search criteria that will create a worksheet with only the rows that meet this criteria. I am not sure what method to use to accomplish this.

## Sorting Results With IF Statement

Dec 28, 2007

Here is a sample of my data in the column starting at I2:

1600 (I2)
57000 (I3)
256000 (I4)
5700000 (I5)

I want to sort results so that the adjacent column gives a ranking code of "A" , "B" , "C" or "F"

my requiremetns are:

iF I2 = less than 65,500 then "A"

IF I2 = 65001 - 250000 then "B"

If I2 = 250001 - 1,000,000 then "C"

If I2 > 1,000,000 then F

The folks at "A" are above average, "B" are average, "C" below aveage with significant concerns and "F" are Critical nonformance, immediate action required.

Of course I plan to copy the formula down the range.

## Nested If Statement - Calculate Value Based On All Of Active Cells In Column

Sep 11, 2013

I am putting together a procedure to calculate a value based on all of the active cells in column "A" and a couple other conditions. "k" is my variable to put a value into (k,8) until all the active cells in column A have a corresponding value in (k,8)

I have my scenarios all built out into If statements and the code runs....but no value is being added to cell (k,8) for any of the rows with entries in column "A" when the procedure is finished running. Depending on the values in (k,2) and (k,3) there are four different ways the value in (k,8) needs to calculate as I have built out below. Why my values aren't being added to (k,8)?

Code:
Sub CalcSpecialFee()
Dim k As Integer
Dim cell As Range
k = 4
Application.ScreenUpdating = False
Sheets("Summary").Select

[Code] .........

## Concatenate Cells To Produce Full Postal Address

Feb 7, 2009

I am trying to simplify the manipulation of data to create a full postal address from a range of cells.

Due to the varied way in which postal addresses are made up, I have found it necessary to create a 2nd Worksheet, which uses helper columns to ensure that spaces and commas appear in the right places.

I recently came across some code on this site from JBeaucaire which I have tried out but in my particular workbook, the commas and spaces do not come out correctly.

The enclosed sample workbook contains a selection of addresses which should cover most of the variations for addresses in the way that they are entered in my main workbook.

Sheet1 (Master) is the main data.
Sheet2 shows the formulas that I have used to create a full postal address.
Sheet3 makes use of a VBA Module and shows the results.

I felt that VBA code is the right way to go but I'm unable to modify the code to make it work or come up with an alternative VBA solution.

## If Statement With Command - Check Results

Nov 28, 2012

I am trying to create an if statement that would check the results of a drop down menu and return a command to the user to enter certain information.

I created a drop down list, offering a list of projects 'a', 'b' or 'c'. I then created an if statement in the next cell. If user chooses project 'a' then the cell will return the project number associated with the project. The issue I am running into is that if the user chooses project 'c' in the drop down I need the cell to return a command for the user to enter the project name in the cell rather than the cell return the project number. How do I do that?

## Countif Statement With NA Results For Chart / Bar Graph?

Mar 14, 2014

I have a countif statement based on certain criteria in a table which is reading off of a drop down list on a separate sheet.

Apple (a1) =COUNTIF(Table2[Fruits],+'Drop Downs'!A1) ...and the results are 3
Pear (a2) = =COUNTIF(Table2[Fruits],+'Drop Downs'!A2) ..and the results 0
Banana (a3) = =COUNTIF(Table2[Fruits],+'Drop Downs'!A3) ...and the results are 1

I have also set up a bar graph (this may change to a pie chart at some point) which is feeding from this. My question is, if I do not want to any results with 0 value to show up on my chart (both on the X&Y axis), how do i amend the formula to do this? I read in a couple of places about the NA() function or about just hiding the rows, but if this chart is updated "live"on a weekly or monthly basis, I would like to chart to move with the data simultaneously...so the numbers will change, sometimes they will be 0, others they may not.

## Return Multiple Results In Multiple Cells Based On Criteria In Yet Another Cell?

Feb 1, 2012

Worksheet 1: In column A I have a people's initials. In coumn B I have text boxes with miscellaneous text. (The same person could have multiple rows within this sheet.)

e.g.
AAA blue
BBB orange
AAA round
CCC smelly
AAA elongated

Worksheet 2 I want to show:
A2 = initials, B2 = first text box associated with that person, C2 = second text box (different row) associated with that person (if applicable), D2 = third text box (different row) associated with that person (if applicable), etc.

e.g.
AAA blue round elongated
BBB orange
CCC smelly

## If Statement In Macro: Macro To Change A Range Of Cells Colours Based On A Single Cell?

Mar 16, 2007

1st - Need a macro to change a range of cells colours based on a single cell having a value greater than 0.001. ie. cells A1 - G1 need to change to grey based on cell F1 having a value greater than 0.001 entered in it?

2nd - Also a macro for deleting the text contents of cell C1 based on cell F1 having a value greater than 0.001. Therefor if cell F1 has a number greater than 0.001 it changes the colour of celss A1 - G1 and also deletes the text in cell C1?

## Change Formula To The Results Of The Formula For Cells That Have Results

May 9, 2006

I have a range that has formulas that are based on other fcells outside the range.

What I want to do is, if the cell has a value to remove the formula and paste the results. If the filed is blank (no results from the formula) to leave the formula in place.

There could be a marco to run when this process is needed.

example attached

## Countif Statement: Count The Number Of Cells That Have A Value Greater Than 0 In A Range Of Cells

Jun 23, 2009

How do I count the number of cells that have a value greater than 0 in a range of cells?

## IF Statement Within A COUNTIF Statement: Cell In Sheet "Summary" Count The Number Of Cells In Column DX Of Sheet "Analyses" That Are Greater Than 0

Apr 22, 2009

I am trying to have a cell in sheet "Summary" count the number of cells in column DX of sheet "Analyses" that are greater than 0, provided that the value in column A of "Analyses" corresponds with the value in B8 of sheet "Summary."

(In "Analyses," there are 106 subjects, each taking up 64 rows. So, columns 1-64 correspond to Subject 1, columns 65-128 correspond to subject 2, etc. In column DX, each subject has 64 values that are either 0 or greater than 0. In "Summary," each subject has one row that summarizes the 64 trials. I want a single cell in the "Summary," sheet to reflect the number of times each subject produces a value greater than 0 in column DX of "Analyses.") I tried using this formula, but it did not work correctly:

=COUNTIF(IF(Analyses!\$A\$1:\$A\$10000=Summary!B8,Analyses!\$DX\$1:\$DX\$10000,""),">0")

(Summary!B8 = 1, so I am trying to calculate the number of values in DX that are greater than 0 only for subject 1.) When I press enter, this yields a value of 384. This is impossible, given that subject 1 only has 64 possibilities of yielding a value greater than 0. Subject 1 has 2 values in column DX that are greater than 0. I tried making this an array formula by pressing Shift+Ctrl+Enter, and that just gives me a #VALUE! error.

## Results Based On Filter

Jun 21, 2006

I have a basic spreadsheet with a column of names of people (Matt, John, Mike), and specific sales numbers for each. I would like to have a cell give an average of the sales numbers based on how I filter for either Matt, John, or Mike individually.

For example: If I filter to see only Matt, I would like to see the average for Matt only, and when I filter to another name such as John, I would like to see the average number change to see only John's.

## Sum Results Based On Drop-Down Values

Jan 31, 2010

I'm trying to populate the Hourly Rate from 4 different Vendors based on 2 conditions.
What is the AREA and what is the Category.

The Area is a pick list (10 unique values) and the Category is a pick list (50 unique values)

If A2 is picked from AREA and B5 is picked from Category THEN populate the value of C5,D5,E5,F5 into the cells of J2, K2,L2,and M2 ...

## IF Statement Based On Dec 31??

Nov 30, 2008

Is it possible to use an IF statement based on Dec 31 - of any given year? If Cell B22 contains Dec 31 (year doesn't matter), I need to subtract 1 day from the date in Cell F2. This only pertains to Dec 31. If any other date of the year is in B22, no calculation should take place.

## Create A List Of Results Based On Criteria

Sep 21, 2012

Col A has list of order numbers, col D has list of corrisponding order status (open , closed etc etc)

I simply want a formula to display a list of all the 'Open' order numbers in a separate sheet.

Obviously to size of the list will vary depending on how many open orders there are.

## Drop Down Menu Based On Vlookup Results?

Feb 2, 2013

im trying to create a drop down menu that changes depending on the results of a vlookup. example: I have a vlookup function that populates a field with a product name based on the part number, however in some cases there are multiple products with the same part number. is there a way to create a drop down menu that contains all the product names shared by the same part number based on the part number that was entered?

## Formulas Based On Results From Dropdown Menu?

Dec 23, 2013

I am building a sheet that facilitates managers at our company decipher information that is given to them on a daily workbook I created.

I want to have a drop down menu in Col J, that refers to the major questions they will ask.

Time started (Before)
Time Finished (After)
Number of Cards (More than)
Stops Per hour (more than)
Amount of Time Taken (More Than)

I have set up in Col (K) a secondary drop-down list which based on the question selected in (J) will offer options for the answer E.G Time questions will make (K) refer to options based on time and selections based on amounts will offer numbers as an answer.

The elements in brackets are the parts of the formula that create the search option. E.G If select 'Time Started' it will search for all records that started before the time selected in the next col (K)

Right if that makes sense.. I have completed this. so I have the following: A question drop down list in (J), and an answer drop down in (K) which is dependant on the type of question asked. (I have attached an example)

I want to now have a totals box after the question where it displays a total amount of cols that are true to the details in the question.

After that (if possible) I will want to use conditional formatting to highlight the ones that reflect to the question.

Realistically if possible i wouldnt mind creating a question box, a box that allows them to select 'more than', 'exact' or 'less than' and then the specific value. Basically a conditional formatting box for dummies within the worksheet. Attached is a demonstration.

## Conditional Formatting Based On Two Cell Results

May 6, 2009

I have a cell which I want to colour green if C6>9, yellow if O6>60 and red if BOTH C6 and O6 are above their respective numbers. The first two parts of this are obviously straight forward, but I cant work out how to get the third part of it to work.

## Changing Order Of Text Based On Results?

Oct 7, 2013

I've attached a spreadsheet. I want the order of the sentence to change based on the numbers and whether they are positive or negative. Below are more details and the spreadsheet has numbers.

"Total expense for September was 8 higher (lower) than prior year, driven by a higher (lower) claims expense and admin expense"

This might be hard to explain: For the second part (starting from "driven by", I would like the variable that explains more of the positive or negative variance (in the example, claims) to come first.

Here is a different example

Total expense for September was 6 lower than prior year, driven by a lower admin expense (claims is not included because it is higher)

## Return Text Results Based On 2 Criterion

Oct 6, 2008

I am attempting to create a formula that will, return text results based on 2 criterion.

This is what my sheet looks like

Name Job Full Time / Partime
Barry Accounts Part Time
Chris Claims Full Time
Emma Claims Full Time

The formula I have for this is {=INDEX(A1:A4,MATCH(1,(((B1:B4)="Claims")*((C1:C4)="Full Time")),0))}

Which is fine and returns the name Chris, however as you can see from above, Emma also meets the criteria given however, I cannot get Emma to appear also. Is it possible to display more than one entry in a cell/s based on this formula, or am I missing something.

I would use a pivot table to do this, however I need the sheet to be completely automated.

## Return Value Based On Results Of Conditional Formatting

Apr 19, 2012

I have a report that shows when our company has shipments covered by inventory (although you are not seeing the conditional formatting in the table). Columns K:Q represent shipment dates and shipment amounts. Columns D:I represent inventory with Column J being the total inventory. The conditional formatting works to highlight the cells in K:O of when shipments are covered by inventory. I need to be able to return the date (Columns K:Q) for an item (Column B) when a shipment is not covered by inventory.

For example Row 154: all shipments are covered by the amount of inventory. A shipment of 3 on 04/24 is more than covered the 105 pieces of inventory. But for Row 170, the shipment for 480 pieces on 04/23/12 does not have enough inventory to cover.

The result I need to return for row 170 is that 480 pieces are due on 04/23/12 that are not covered.

What formula would I used to return that value?

Excel 2010ABCDEFGHIJKLMNOPQ1LineITEMNEXT CUSTOMER PART WIP INVENTORYSTAGINGFINISHEDINSPECTDCYTRAILERTOTALPast4/18/20124/19/20124/20/20124/23/20124/24/20124/25/2012154Tabber105290325AA05290325AA-DC000010501053155Tabber1070025AC-EXP070025AC-

[Code]....

## Formula To Return Results Based On 2 Parameters?

Jul 5, 2013

1) I have an invoice form, and need to create a formula that will allow me to calculate a discount IF an item number begins with "C" or "CE".

Example: Item # is in cell F12. (may or may not begin with "C" or "CE")

Item price is in cell J12.

Extended price (qty x price) is in cell K12.

In L12, I need to calculate a discount (from % in fixed cell L9) on the figure in K12 - based on whether or not the Item # in F12 begins with a C or CE.

If it does not begin with C or CE, then L12 needs to equal 100% of K12.

(The 2 parameters I referred to in the title were:

C, followed by a number
CE followed by a number )

2) The biggest part of the dilemma is that the person using this spreadsheet is totally unfamiliar with Excel formulas, spreadsheets in general, and has to send this finished product to a client each week. So I need this to be as simple as possible - which seems to me to be a formula (that can be copied to insert rows, etc. if necessary).