Help with variables in cells

BAZ47

New Member
Joined
Jun 24, 2011
Messages
10
I am just starting out with VBA & I'm sinking fast!
I am hoping that there is someone out there who can offer some help with the following.
I have variable values in each cell of 3 columns (6 variables per cell in col1,2 variables per cell in col2 & 2 variables per cell in col3. Based on what is shown in each cell of those columns I then need to display a value (shown in a cell on another worksheet) in each cell of column 4.
Hopefully a solution is possible with VBA.
Thanks in advance.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Welcome to the MrExcel board!

A few sets of sample data and the corresponding results may well help clarify what you are after.
 
Upvote 0
Thanks for the welcome Peter.:)

ITEM GRADE COUNTRY DELIVERY
APPLES 1 MEXICO YES
BANANAS 2 CUBA NO
CHERRIES 3 GUYANA
CUCUMBERS
BEANS
APRICOTS

Above is the type of data I'm dealing with. What I am trying to do is similar to using an IF function.
eg.
IF(A2="CHERRIES", IF(B2=1, IF(C2="CUBA",D2)))
Where ITEM could be any 1 of 6
GRADE could be any 1 of 3
COUNTRY could be any 1 of 3
The result in the DELIVERY column would depend on the entries in the other cells.

Hope that's clearer.
 
Upvote 0
Hope that's clearer.
Not much I'm afraid. From what I can see your data is set out like below. (You might want to investigate the screen shot methods suggested in my signature block so you can show screen layout better).

Excel Workbook
ABCD
1ITEMGRADECOUNTRYDELIVERY
2APPLES1MEXICOYES
3BANANAS2CUBANO
4CHERRIES3GUYANA
5CUCUMBERS
6BEANS
7APRICOTS
8
BAZ47




But what you want to do with this data is not clear. You gave the example ..

IF(A2="CHERRIES", IF(B2=1, IF(C2="CUBA",D2)))

.. but I can't see how the result D2 flows from the data if A2, B2 and C2 held those values. Why isn't the result D3 or something else?

Also what would you want the formula to return if the conditions are not met.

You might need to fill us in some more on what you are really trying to achieve in your sheet.
 
Upvote 0
You're right, my explanation is quite poor & not really what I meant! :banghead: I think I will go back to the "drawing board" & start over. Thanks for your advice, it's appreciated.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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