Help me figure out how to go about making Excel magic
January 6, 2009 8:43 PM
Subscribe
How can I have Excel generate a new column with the data I need using certain conditions and pulling data from a pivot table?
I have thousands of items and 3 columns of values assigned to each item in a pivot table. I want to say "if column B and C values are identical then put that value in new cell" I also want to say "if values in B and C are not identical then pick whichever of the two is closest to the value of A and put that value in new cell"
Any ideas on how I can do this? I'm relatively comfortable with excel and pivot tables but I've never written a macro before and don't know where to start.
Thanks, all!
posted by ttyn to computers & internet (5 comments total)
1 user marked this as a favorite
See if this works for you:
=IF(A1=B1,A1,(IF((IMABS((B1-A1))>(IMABS((C1-A1)))),C1,B1)))
I'm assuming you know how to add the "$" so you can copy the formula down the column.
posted by boeing82 at 9:35 PM on January 6