Need help bringing code from Google Spreadsheet into Excel

FastNOC

New Member
Joined
Jul 9, 2013
Messages
2
I'm very frustrated right now. I'm not a spreadsheet guy but i needed to make a fairly complex (well for me) spreadsheet to track money.

I wrote some functions after researching how to do this at Google. I'm not a developer so this was all done by searching and reading reference material. i also put some if statements in cells to bring in graphics. i have no clue at all how to bring this into excel, but I'm afraid I'm going to have to start all over and I'm hoping someone can help. I'll bag the majority of them ( like i wrote a function to auto update a time stamp in a cell when an adjacent cell was edited) and other miscelaneous things, but there are two things i'd like to bring over.

1. in cell if statements. I wanted to bring in arrows to show ups and downs in funding. i researched to find a way to do this at google docs. however, when i export the spreadsheet to an excel doc, excel is stripping the code. i'm assuming it thinks it's malicious. so i need to find the best method to implement this in excel.

Rich (BB code):
=if(F11=G11;"-";if(F11>G11;image("http://i.imgur.com/FgExlfS.png");image("http://i.imgur.com/BUly6gK.png")))

the result brought in arrows up and down depending on the dollars. it looked like this:

agUbSAk.png


2. a script that changes the colors of the text in a cell based on a positive or negative resulting calculation. this is written for gs code:

Rich (BB code):
function onEdit(e)
{
  myFunction("F194","G194","G196");
  myFunction("M194","N194","N196");
  myFunction("F208","G208","G210");
  myFunction("M208","N208","N210");
}

function myFunction(Cell1,Cell2,Cell3)
{
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getActiveSheet();
  var ValueOfCell1 = sheet.getRange(Cell1).getValue();
  var ValueOfCell2 = sheet.getRange(Cell2).getValue();
  
  if( ValueOfCell1 > ValueOfCell2 )
    sheet.getRange(Cell3).setFontColor("RED");
  else if( ValueOfCell1 < ValueOfCell2 )
    sheet.getRange(Cell3).setFontColor("GREEN");
  else
    sheet.getRange(Cell3).setFontColor("BLACK");
    
  return "";
}

this has many more lines of cells but you get the idea.

other than that, it looks like the rest of what i did ported fine, as the method is the same, or similar. they're just simple fomulars to add columns, get percentages, etc.

if I can resolve this, i can forget about google docs for spreadsheets, i can't believe some of the things i've learned that seem so basic, but aren't possible there. For instance, it is not possible to select multiple cells (as you'd do by control clicking in excel) in good docs unless the cells are adjacent. you can select rows, columns or parts of each, but not together, and no cells that aren't adjacent.

the other show stopper for me is that terrible 'auto save'. it forced me to make duplicates of my work every time i needed to dev, to protect the other work. Google does an auto save that to me is insane. and the 'undo' is sporadic, and doesn't work at all sometimes.

so if anyone could help me i'd be very grateful.

Thank you.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Welcome to MrExcel.

You can't use a formula like that to display an image in Excel, but you can use Conditional Formatting with Icon Sets. Do a Google search for that and you will get plenty of hits.
 
Upvote 0
Welcome to MrExcel.

You can't use a formula like that to display an image in Excel, but you can use Conditional Formatting with Icon Sets. Do a Google search for that and you will get plenty of hits.

you know, yesterday was a very troubling day for me. I had worked on that stupid spreadsheet for hours. i'm a newbie. for instance, i did not know that you can copy/paste a cell into the same colums in the next row and it will auto update the formular to do the same thing, but use the different numbes.

i was manually copying to code, then changing the cell numbers in the if statement. all i had to do was copy the cell itself, and paste it to the next row and it would auto correct the cell numbers. I'm assuming this works in excel too. it would have saved me many minutes of precious time i spend doing it manually had i realized it. thankfully it dawned on me that was happening about half way through doing it to about 300 rows of cells. lol

That's the problem, i am very good at finding solutions, but being new i'm inefficient at doing so. Take your answer, i knew i should have just started searching for that answer, but i was frustrated and very tired.

Thanks for the help, it should have been obvious, and I apologize for taking the lazy way out. You did answer the picture question though which helped.

I'm hoping i can figure out how to write a vbscript to do the same thing i did at google. it has to be that simple. if i could figure it out at google i can do the same here.

Thanks for the reply
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,597
Members
449,038
Latest member
Arbind kumar

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