Programming Multiple Conditions In Cell

Jul 6, 2009

Attached is my worksheet. I need to program column C to adjust the value in column A according to the rules set in table J2:K17, but ONLY if the value in column B = mens. If the value in B does not equal mens, then leave the C cell blank. I've manually populated column C to show the end result that I'm looking for.

I tried a simple =IF(ISNUMBER(SEARCH("Small",A2)),"S",""), etc., but I can't figure out how to incorporate the additional condition that would let the cell return a value ONLY when a condition in B is also met.

NBVC helped me with a similar request previously, but with that formula, if the condition wasn't met, the cell returned "#N/A" instead of being blank.

View 14 Replies


Programming Multiple Inputs With Multiple Data Fields

Feb 19, 2009

I am trying to set up a "diet log" for my nephew to track his eating habits for a school project. I am trying to make the "total" section of the attached spread sheet auto calculating depending on the information placed in the "breakfast / lunch / dinner / snack" catagories. I have two worksheets in the file. The first being the preferred method of a single cell and seperating the items using only a ",". The second sheet has a little bit different lay out which I don't think will work as nicely.

Honestly, I am not sure if this will even be possible, but I figured I would try here as a final resort. Currently there are just some sample foods in there as I will let him fill in the actual workbook for his use.

View 7 Replies View Related

Programming Macro To Operate Over Multiple Sheets Or Workbook

Aug 1, 2012

I'm trying to set up a way to format column widths and row heights in a macro (so that it can read a value from a cell and format a column to that width). I've used the code below which can be repeated for the number of rows and columns desired below

Worksheets("Sheet1").Range("d1").ColumnWidth = Range("d1")

However, I want to be able to do this on a workbook that could potentially have 40+ sheets. Is there a way of applying this code to operate over the whole workbook rather than just one sheet at a time?

View 7 Replies View Related

VBA To Set Cell Value Based On Multiple Conditions

Jan 4, 2013

I am creating a document log that tracks all excel files sent and received.

I use RDBmerge to get the filenames and data from the file batches.

My current macro edits the data down to the last stage of data needed to create the log.

My example workbook shows the final stage of the RDBMerge Data "Rough_Data" and then the final data formatted needed for the Log "Final_Data"

Included on the "Rough_Data" worksheet is the Code log used to complete the "Final_Data" worksheet.

I have highlight the cell range on the "Final_Data" Sheet that I need to complete.

filenames can occur multiple times from the RDBmerge, so only one occurance of the filename is place in column B of the "Final_Data" worksheet.

The criteria is this:

A column on the "Final_Data" worksheet as been Named for Each of the possible "Record Types" from Column G of the "Rough_Data" Worksheet. ("A,B,C,D,E,I,O,P,Q,T,V,W,X,Y")

I then must look through the "Rough_Data" worksheet for the first occurrence (if any) of that record type for each filename on the "Final_Data worksheet. If an occurrence is found I then must look at the "Unique ID" & "Program" Columns of the "Rough_Data" Worksheet. The key (on the "Rough_Data" worksheet) is used to determine the code that is written to the corresponding cell.


[Code] .....

I would very much like to automate this process, as sometimes I am dealing with over a hundred files with 30 plus rows of data each.

View 9 Replies View Related

Cell Value Based On Multiple Conditions

Feb 23, 2010

I need to create a macro that will calculate a value based on the contents of multiple cells. Looking at the example attached, if columns A and/or B (employee ID and name) are empty, then allowable OT (G) should be 0. If either have data, then if Stage (F) is CAN, G should be 20. If Stage is FAS or FAR, G should be 10.

I'm not very savvy with IF statements, which is how I imagine this can be done, and I don't know if this would be easier to do as a macro or as a formula within G. Since the contents of the of the cells will be changing on a weekly basis, I'd prefer the formula to only be there if there is content on the line, so we don't have nulls showing.

View 7 Replies View Related

Multiple If Statement: Value Returned In Cell C3 If Two Conditions Are Met

Aug 27, 2009

I am trying to have a value returned in cell C3 if two conditions are met. In Cell C3 (Sheet 1), if the value in Cell A3 (Sheet 1) is listed in column A on sheet 2, and the 12031 is listed in column B on sheet 2, I need the value of Open to be returned.

View 3 Replies View Related

Formatting Cell Colors With Multiple Conditions

Oct 29, 2008

so what will happen is that the number of rows will continuously increase as the groups of data (Labeled Group #) increases. The data within each group will vary from time to time so some groups may contain only one line while others may contain multiple lines. I have included an attachment that illustrates what I'm trying to achieve. When data is entered in Column A under "Q," the adjacent empty cells in Columns B-F (labeled "R"-"V") will turn red. This is the part I have (i.e. Group 2).

View 4 Replies View Related

How Do I Program Multiple Conditions Within A Cell In Excel?

Jun 3, 2009

Trying to program cell C1:

If A1 is between .81 and 3, AND if B1 is Adult, then C1 is Priority Mail
If A1 is greater than 3, AND if B1 is Adult, then C1 is FedEx Ground
If A1 is Less than .81, AND if B1 is Adult, then C1 is First Class Mail
If A1 is Less than .81, AND if B1 is Child, then C1 is Hold for Inspection


There will be a list of ~45 conditions that will populate a specific value in C1. Can this be done? If so, how?

View 6 Replies View Related

Format A Cell To Accept Multiple Conditions

Jun 12, 2009

if I want 2 conditions satisfied in order for a value to be returned, would I need to set up/name tables, set ranges, etc? e.g,

If A1 contains baby, AND B1 contains Carly, then C1=carly.jpg
If A1 contains girl, AND B1 contains Carly, then C1=carlyg.jpg
If A1 contains baby, AND B1 contains Billy, then C1=billy.jpg
If A1 contains summer, AND B1 contains Wally, then C1=winter.jpg

Roughly 40 different conditions will be needed. What formula would I use and how should I name and set up my table?

View 4 Replies View Related

Check Conditions In Multiple Cells With One Cell

May 22, 2006

=AND($AE$2:$AE$10<=$F$2:$F$2000;$AE$2:$AE$10>=$E$2:$E$2000) With this I am checking for conditions to be true or false

Lets say I am checking AND(AE2 <= F2 ; AE2>=E2) this tells me if date in cell
AE2 is smaller or equal to Cell F2, but how can I set this fromula to check if all the cells from F2 to F1000 are equal to AE2 so If I write date into Cell AE2 it checks all dates from F2 to F1000 and check if condition is true or false
(and if I write date in cell AE3 it should check all the dates from F2:F1000, if date in AE3 is in this range)

View 9 Replies View Related

Nesting Multiple IF/ANDs: Get Any Value In The Cell If Either Of The Conditions Are True

Apr 20, 2009

Trying the following syntax and I do not get any value in the cell if either of the conditions are true. Pretty sure I'm nesting the functions incorrectly. Maybe I should use Index/Match? =IF(AND(E24="SI",F24="SI"),"ER2","",)IF(AND(E24="sn",F24="sn"),"er2","")

View 3 Replies View Related

Excel 2010 :: Highlight Cell If Multiple Conditions Are Met?

Sep 19, 2013

In column A, I need to highlight the cells green if the value is less than < the values in columns B and C, yellow if A = either B and C, and red if A is greater than B and C. But I only want the formatting to stay in column A. I'm using Excel 2010 and Windows 7.





View 2 Replies View Related

Extract Cell Values By Conditions From Multiple Worksheets

Jun 25, 2008

I am trying to write a Macro that would go into same specific cells in multiple worksheets and paste the data into one summary worksheet if ofcourse a criteria is met.

The multiple worksheets have the same format. The worksheets are numbered 001, 002, 003, 004, etc (increase on a daily base) ..

View 3 Replies View Related

Change Cell Background Color Based On Multiple Conditions

Aug 6, 2008

My Excel skills are basic at best, with no knowledge of VBA other than finding the VB Editor. What I'm trying to do: Attached is the file I'm working with, to give you a better idea. When a name is selected in column B, the cells in the non corresponding columns E to N should have a black background color. For example, when you select Mike in column B, the cells in that row in columns I to N, named Dave and Dean, should become black. If you select the name Dave, columns E to H (Mike) and M to N (Dean) should become black. In addition, the background color of the non-black cells should change depending on the status.

OK : green
FAIL: red
N/A: orange
Exceptions: blue

The attached file shows a few possible results, manually entered.

View 7 Replies View Related

Count Unique Logs With Multiple Conditions Of Multiple Sheets

Oct 8, 2007

I've got no clue about all this, but I've had to get specific formula examples and fill in the blanks in order for my timesheet to work. There's just one final problem if somebody could please help.

This is a timesheet for a 5 day work week. I need to count the number of unique log numbers for a specific activity. The log numbers counted must be unique across the entire week, not just for each day, which means I want the formula to count the unique log numbers across multiple sheets.

The formula also has multiple conditions. I got 2 columns. The first part of the formula needs to verify a word, say, "split" and if it does it checks the adjacent cell for a unique log number. If both arguments are true, it counts the log as 1 unit.

Here is a working formula for only one page.

Here's 2 problems with this formula:
1. I will count if it encounters a blank cell in the Log numbers the first time (which will happen as not every activity we do has a log#), but it will stop counting if it encounters a second blank cell.

2. I don't know how to make it work across several sheets.

This is an alternate formula which works and skips the blank cells, but I don't know how to add the multiple condition of "split" and to have it work across multiple sheets. I just copied it Microsoft. As I said, I don't understand it, I just fill in the blanks.

SUM(IF(FREQUENCY(IF(LEN(C4:C29)>0,MATCH(C4:C29,C4:C29,0),""), IF(LEN(C4:C29)>0,MATCH(C4:C29,C4:C29,0),""))>0,1))

View 11 Replies View Related

VBA Programming

Dec 12, 2006

This may be a bit of a silly question but any assistance would be much appreciated, as I cannot figure out where I am going wrong:

Dim RRR As Range
Set RRR = Range("c3").End(xlDown).Select

What I am trying to do is to create a dynamic range called 'RRR' so that everytime the macro is run, it makes sure that all the data is selected in the column.

View 9 Replies View Related

If, Then, Copy Programming

Jul 7, 2008

I have attached a worksheet as my example.

I have been trying to build code and I am a newbie when it comes to this.

I have a sheet that is user entered (Criteria). I need to build a macro/code that says if they choose "Yes" to any of the Products on the criteria sheet, then copy all rows that have an X in them that are in the corresponding column on the Master Template. To make it even more complicated I only want to copy 4 of the columns (ID, Task, Share with Client and Accountable).

I know if they choose multiple columns then I could have duplicate rows, but once all the rows are copied I was going to build a remove duplicates macro. However, if there is anyway of preventing duplicates with the original.

View 13 Replies View Related

Programming A Userform

Oct 23, 2009

I need help to get the macros right to do the following that it can not do now:

I would like the user to be able to pause in between input areas and do others things.

Need for the input length to be varible or grow with the information

Are these things possible?

View 11 Replies View Related

Book On Programming

Jun 19, 2008

I have only the basic knowledge of the VBA programming. Are there any books you can recommend?

View 2 Replies View Related

Remove Multiple Data By Multiple Conditions?

Aug 21, 2009

1. I have 4 columns (let's say D,E,I,J);

Account1 Sum1 Account2 Sum2
151 93,79 BF2479 30,00
1476757 93,79 BF7 22,00
BF2479 30,00 151 93,79
86041 84,03 23235 30,00
534 6608,45

2. I need to clean the multiple identical data in the list by both Account no. and Sum (of course the list is much longer!) so that the list should look like this:

Account1 Sum1 Account2 Sum2

1476757 93,79 BF7 22,00

86041 84,03 23235 30,00
534 6608,45

I must say that I am a beginner in Excel, so I tried to use this:


for column E, and


(which is reverse of the first one) for column J; (The ranges are the ones used in the real sheet), not for the ones in the example above!); The formula does seem to eliminate a dew unwanted data, but does not give me all the wanted results!

View 4 Replies View Related

How To Satisfy Multiple Conditions Using Multiple Criteria

Oct 16, 2009

I'm trying to divide my data into 6 different groups, based on 2 different criteria. First, I am not sure how to write the logical test to take 2 columns of data into consideration (using "&" and "AND" do not work; I am not sure what else to try), and second I can't figure out how to write the formula so that it can select from 1 of 6 conditions.

So, overall here is what I want:

If DL2=3 and CK2=1, then I want this to be labeled as '1'
If DL2=3 and CK2=2, 2
If DL2=1 and CK2=2, 3
If DL2=2 and CK2=2, 4
If DL2=1 and CK2=1, 5
If DL2=2 and CK2=1, 6

These 6 conditions cover all possible combinations of numbers in the two columns.

View 13 Replies View Related

Vba Programming Generate List?

Nov 18, 2012

I am looking for a code to generate a combinations of x numbers taken 5 at the time. t

View 2 Replies View Related

Programming A Search Function

Jul 30, 2008

how to type a name into one cell and have all the places in a particular range (a1:H12) that displays that name to highlight a color.

View 14 Replies View Related

(Mailing List) Programming

Aug 9, 2007

i could create a spreadsheet with two columns one with email addresses and another with a path to an attachment

e.g. column a =
column b = c: est.xls

and then for a macro to read my data, and send an email to those email addresses in column a with the attachment of column b

View 14 Replies View Related

Programming A New Command Button

Dec 13, 2008

I have created a userform with text boxes and a list box. I have a few questions. First for the list box. I got the information for my list box through the list box example sheet2!A1:A1000. Is there any easier way ? Next I would like to create a New Command button to create a new record. I decided to just do a clear all textboxes, option buttons ect.. to clear, is there an easier way ? I seem to be looping sort of way when I get to txtissue.Value = "" it than goes to txtIssue_Change()

View 14 Replies View Related

Programming A List Template

Dec 15, 2008

I have a base list of numbers on a spreadsheet that represent specific values. For example, Column A has a list from cell 1 to 20 that contains a group of different numbers that all represent credits. Column B also has a list with different groups of numbers that represent debits. Each month I receive a report with a large list of numbers that contain credits and debits. I sort the list and use my base list as a reference to differentiate what groups of numbers are debits and which ones are credits.

I am hoping there is an easier way to do this. My question is, is it possible to use the base list that I have as a template so that the next time I receive a report, I can just copy and paste the numbers onto the template and have them somehow formatted or programmed to reflect their correct code of either debit or credit?

View 9 Replies View Related

Compare Dates In VBA Programming

Jun 8, 2006

I need to compare dates in excel (VBA programming). How can I do to Compare two dates. If I wanna know the difference between to dates (days, moths and years)

View 2 Replies View Related

Transpose Function Using VBA Programming

Jun 21, 2006

I have an excel sheet which has 5 columns & 5 rows.I would like to transpose values in 3rd column to 5th column .But after running my code I am not being able to get the deired output. rectify the error for me?

xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)

xlSheet. Cells(1, 1) = "NAME"
xlSheet.Cells(1, 2) = "CITY"
xlSheet.Cells(1, 3) = "STATE
xlSheet.Cells(1, 4) = "ADDRESS"
xlSheet.Cells(1, 5) = "PINCODE"

View 9 Replies View Related

Excel Programming That Sends Email To Different Recipients?

Mar 26, 2014

I been trying to create stuff that will make my work life real easy. I need creating a program that will send an email to different recipients. I created a spreadsheet the contains different information. When a persons name is selected on Column D, excel/outlook will generate an email to that person containing the info on Column A to D.

And then as soon as the work is processed and column G is filled, outlook will generate an email back to who created the requests column A.

View 7 Replies View Related

VBA Conditional Programming - Background Colour When Criteria Not Met

Sep 17, 2009

I have some code below which looks at values added between a set range of cells. This works OK.

My problem is when i have to change the cell as it removes the background colour already set to certain columns ie Columns I, J, P, Q, W, X, AD, AE (these are coloured a light green).

The other cells in the range have no colour and so the code below works with no problem.

View 6 Replies View Related

Copyrights 2005-15, All rights reserved